#include <iostream>
#include <string>
#include <cstdio>
#include <string.h>
#include <map>
#include <iterator>
#include <ctype.h>
using namespace std;
string str;
map <string, int> store;
map <string, int>::iterator it;
char change(char ch)
{
if (ch >= 'A' && ch <= 'Z')
{
ch += 32;
}
return ch;
}
void input()
{
while (getline(cin, str))
{
string s = "";
for (int i = 0; i < str.length(); i++)
{
if (isalpha(str[i]))
{
s += change(str[i]);
}
else
{
if (s != "")
{
store[s]++;
}
s = "";
}
}
if (s != "")
{
store[s]++;
}
}
for (it = store.begin(); it != store.end(); it++)
{
cout << it->first << endl;
}
}
int main()
{
input();
return 0;
}
ACM-uva10815
最新推荐文章于 2015-08-02 12:03:01 发布