为什么i(即求的数的个数)的值会停在3啊?

#include<iostream>
#include<cstring>
#include<cstdio>
#include<sstream>
#include<cmath>
using namespace std;
int main()
{
string a[1010],c[1010];
string x;
for(int t;t<1010;t++)
c[t]=" ";
int i=1;
getline(cin,x);
for(int m=0;m<=sizeof x;m++)
{
if(x[m]==' ')
i++;
else a[i]+=x[m];

}
for(int q=1;q<i+1;q++){
int p=0;
stringstream ss;
ss << a[q];
ss >> p;
cin>>c[p];
}
for(int z=0;z<i+1;z++){
if(c[z]!=" ")
cout<<c[z]<<endl;
}
return 0;
}

0 条评论

目前还没有评论...

信息

ID
1389
难度
4
分类
模拟 点击显示
标签
(无)
递交数
2190
已通过
915
通过率
42%
被复制
9
上传者