国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

1071. Speech Patterns (25)

2019-11-11 03:10:42
字體:
來源:轉載
供稿:網友

題目:https://www.patest.cn/contests/pat-a-PRactise/1071

代碼:

#include<cstdio>  #include<cstring>  #include<cstdlib> #include<cmath>#include<map>#include<string>#include<iostream>#include<algorithm>  using namespace std; bool check(char c){   if(c>='0'&&c<='9')return true;   if(c>='a'&&c<='z')return true;   if(c>='A'&&c<='Z')return true;   return false;}int main()  {   	map<string,int>s;	string str;	getline(cin,str);	int i=0;	while(i<str.length()){		string temp;		while(i<str.length()&&check(str[i])==true){			if(str[i]>='A'&&str[i]<='Z'){			     str[i]+=32;			}			temp+=str[i];			i++;		}		if(temp!=" "){			if(s.find(temp)==s.end()) s[temp]=1;			else s[temp]++;		}		while(i<str.length()&&check(str[i])==false){		  i++;		}	}	string final;	int max=0;	for(map<string,int>::iterator i=s.begin();i!=s.end();i++){		if(i->second>max){			max=i->second;			final=i->first;		}	}	cout<<final<<" "<<max<<endl;    system("pause");  }                  


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 抚宁县| 丰城市| 夏邑县| 繁昌县| 高要市| 元谋县| 余姚市| 石阡县| 孝感市| 化德县| 泰顺县| 栖霞市| 彭州市| 苏尼特左旗| 土默特左旗| 三穗县| 孟州市| 邵武市| 城固县| 米易县| 万荣县| 阳朔县| 岳西县| 响水县| 扶绥县| 无棣县| 荆州市| 金昌市| 应用必备| 阿拉善左旗| 东山县| 大荔县| 林芝县| 宿州市| 永仁县| 河东区| 建德市| 邳州市| 宝清县| 同江市| 镇宁|