这个正确的程序为啥运行后输入没反应呢
就是输入“a b ee gg”后按回车了啊,小写变大写的程序#include <iostream>
#include <vector>
#include <string>
using std::cin;
using std::cout;
using std::endl;
using std::vector;
using std::string;
int main()
{
vector<string> vec;
for (string word; cin >> word; vec.push_back(word));
for (auto &str : vec) for (auto &c : str) c = toupper(c);
for (int i = 0; i != vec.size(); ++i)
{
if (i != 0 && i % 8 == 0) cout << endl;
cout << vec[i] << " ";
}
cout << endl;
return 0;
}