如何解决错误:使用未声明的标识符'Solution'vector <int> ret = SolutionplusOneparam_1;返回ret
试图在第n个项上加+1,并在上面提到的leetcode窗口中显示错误
#include<iostream>
using namespace std;
int main()
{
int n;
int a[n];//array of n number
cin>>n;
for(int i=0;i<n;i++)
{
cin>>a[i];
}
for(int i=0;i<n;i++)
{
if(a[i+1]==a[n]) //I am trying to add +1 to nth term of array
{
a[i]=a[i]+1;
}
cout<<a[i];
}
return 0;
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。