第一种:
所用头文件:sstream
string s;
getline(cin,s);
istringstream ss(s);
int e;
int n = 0;
int A[maxn];
while(ss >> e){ //读取输入值 ,e也可以为字符串
A[n++] = e;
}
第一种:
所用头文件:sstream
string s;
getline(cin,s);
istringstream ss(s);
int e;
int n = 0;
int A[maxn];
while(ss >> e){ //读取输入值 ,e也可以为字符串
A[n++] = e;
}