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

首頁 > 學(xué)院 > 開發(fā)設(shè)計 > 正文

1071. Speech Patterns (25)

2019-11-11 04:45:17
字體:
供稿:網(wǎng)友

題目: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");  }                  


發(fā)表評論 共有條評論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 波密县| 商洛市| 云浮市| 玉溪市| 门源| 集安市| 佛教| 于田县| 龙海市| 岐山县| 滦平县| 台安县| 鄢陵县| 桃江县| 德清县| 开鲁县| 新巴尔虎左旗| 广南县| 从化市| 呼和浩特市| 遂川县| 宜兴市| 屏边| 吉林市| 汶川县| 玛纳斯县| 海盐县| 库尔勒市| 安平县| 山东省| 梧州市| 永德县| 特克斯县| 江川县| 石门县| 山阳县| 遂昌县| 海盐县| 基隆市| 兴国县| 礼泉县|