hiho week 107 register

Ended

Participants:535

Verdict:Accepted
Score:100 / 100
Submitted:2016-07-16 23:21:39

Lang:G++

Edit
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
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
using namespace std;
int main()
{
    string line;
    while (getline(cin, line))
    {
        string spaceLine;
        for (char c : line)
        {
            if (c >= 'A' && c <= 'Z')
                c = c - 'A' + 'a';
            if (c == ',' || c== '.')
                spaceLine.push_back(' ');
            spaceLine.push_back(c);
        }
        vector<string> words;
        stringstream ss;
        ss << spaceLine;
        string word;
        while (ss >> word)
        {
            words.push_back(word);
        }
        bool first = true;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX