I checked again how to index each "word".
#include <iostream>
#include <string>
#include<vector>
using std::cin;
using std::cout;
using std::endl;
using namespace std;
int main()
{
string word;
char index;
vector<string>g_words;
while (cin>> word)
g_words.push_back(word);
for (auto &word : g_words)
for (decltype (word.size()) index = 0;
index != word.size() && !isspace(word[index]); ++index)
word[index] = toupper(word[index]);
for ( auto word : g_words)
cout<<word<<endl;
return 0;
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…