Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
6240 | 张育斌 | 统计字符数量 | C++ | Accepted | 0 MS | 260 KB | 565 | 2025-01-14 15:09:23 |
#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int t[125]={}; char ch[1001]; cin>>ch; for(int i=0;ch[i]!='\0';i++){ t[ch[i]]++; } int _max=-1,t_num=0; for(int i=97;i<=122;i++){ if(t[i]>_max){ _max=t[i]; t_num=i; } } cout<<char(t_num)<<" "<<_max; return 0; }