#include <iostream>
#include <string>
#include <sstream>
using namespace std;
int count(string input){
int count=0;
for(int i=0;i<input.size();i++){
if(input[i]==' ')
count ++;
}
return count+1;
}
int main(){
string in;
getline(cin,in);
int n = count(in);
stringstream stream;
stream << in;
int * input = new int[n];
for(int i=0;i<n;i++){
stream >> input[i];
}
return 0;
}
stringstream输入一行整数(有正有负)
最新推荐文章于 2023-05-08 17:54:34 发布