A1071
Description:
给出一个人的演讲内容,找出这个人最常用的词语。
Input:
- 每个输入一组样例;
- 每个样例包含一个不超过1048576个字符的一段文字;
Output:
- 每个样例,打印出在输入文字中最常用的单词,并且给出频数;
- 如果有多个这样的单词,则打印字典序最小的那个( lexicographically smallest);
- 单词大小写不敏感,输出只输出小写
算法描述:
-
对于每个输入字符,大写换小写
-
没考虑清楚’\n’的处理,导致耽误了好久,比如测试4类似样例:
a //应当输出a 1
#include<iostream>
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
#include<algorithm>
#include<map>
#include<vector>
#include<queue>
using namespace std;
const int maxn = 1048580;
char text