我的代码
#include<bits/stdc++.h>
using namespace std;
vector<int>a;
int main(){
int n=0;
cin>>n;
for(int i=1; i<=n; i++)
{
int x=0;
cin>>x;
a.push_back(x);
}
for(int i=0; i<a.size(); i++);
cout<<a[i]<<' ';
return 0;
}
为什么运行的时候程序会说输出循环的 “i” 出问题?
14 11 [Error] name lookup of 'i' changed for ISO 'for' scoping [-fpermissive]
14 11 [Note] (if you use '-fpermissive' G++ will accept your code)
我看别人也是这么输出的来着
会不会是万能头的问题?