Skip to content

Commit

Permalink
fixed pezy#16
Browse files Browse the repository at this point in the history
  • Loading branch information
pezy committed Feb 14, 2015
1 parent 761a0ce commit b506409
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions ch03/ex3_22.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,15 @@ using std::vector; using std::string; using std::cout; using std::cin; using std

int main()
{
vector<string> vec;
string str;
while (getline(cin, str))
if (!str.empty()) vec.push_back(str);

auto first = vec.begin();
for (auto& c : *first)
c = toupper(c);

for (auto it = vec.begin(); it != vec.end(); ++it)
cout << *it << endl;
vector<string> text;
for (string line; getline(cin, line); )
text.push_back(line);

for (auto it = text.begin(); it != text.end() && !it->empty(); ++it) {
for (auto &c : *it)
c = toupper(c);
cout << *it << endl;
}

return 0;
}

0 comments on commit b506409

Please sign in to comment.