代码(C++)
只输入空格和单词,回车结束
#include <iostream>
#include <vector>
#include <string>
using namespace std
;
int main() {
vector
<string
> s
;
string temp
;
while (cin
>> temp
) {
s
.push_back(temp
);
if (cin
.get() == '\n') {
break;
}
}
cout
<< s
.size() << endl
;
return 0;
}
转载请注明原文地址: https://lol.8miu.com/read-17452.html