代码来源
1 #include<iostream>
2 #include <map>
3 #include <iomanip>
4 #include <string>
5 #include <cstring>
6 using namespace std;
7 map<string, bool>m[101];//如果第i个文件存在单词word,则m[i][word] = true;
8 int same[101][101] = { 0 };
9 int num[101] = { 0 };
10 int main()
11 {
12 int N;
13 cin >> N;
14 for (int i = 1; i <= N; i++)
15 {
16 char ch;
17 int cnt = 0;
18 char t_word[11];
19 while ((ch = toupper(cin.get())) != '#')//统一转换为大写字母
20 {
21 if (ch >= 'A' && ch <= 'Z')
22 {
23 if (cnt < 10) t_word[cnt++] = ch;/*如果cnt>=10,则cnt不会增加,停留在第10个字母后边,
24 直至遇到第一个非字母时将t_word[cnt]置为' '*/
25 }
26 else
27 {
28 t_word[cnt] = '