-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path17.cpp
34 lines (30 loc) · 776 Bytes
/
17.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include <iostream>
#include <stdlib.h>
#include <string.h>
#include <typeinfo>
#include <vector>
using std::cout;
using std::endl;
using std::cin;
using std::string;
using std::vector;
int main()
{
vector<string> v;
for ( string words; cin >> words && words != "eof"; v.push_back( words ));
for (auto i : v)
cout << i << " ";
cout << endl;
for (auto &word : v)
{
for ( decltype( word.size() ) index = 0; index != word.size() && !isspace( word[index] ); ++index)
word[index] = toupper( word[index] );
}
for ( decltype( v.size() ) count = 0; count != v.size(); count++ )
{
if ( count != 0 && count%3 == 0) cout << endl;
cout << v[count] << " ";
}
cout << endl;
return 0;
}