对于一行数据的读入方法(未指明个数) 不断更新中。。。。

第一种:

所用头文件:sstream

	string s;
	getline(cin,s);
	istringstream ss(s);
	int e;
	int n = 0;
	int A[maxn];
	while(ss >> e){ //读取输入值 ,e也可以为字符串
		A[n++] = e;
	}
	

猜你喜欢

转载自blog.csdn.net/weixin_39909619/article/details/88364958