| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 98285 | 刘珩宇 | 统计字符数量 | C++ | Accepted | 1 MS | 276 KB | 483 | 2024-11-17 19:12:12 |
#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(){ char s[1001],j,m; int i,a[1001]={0},max=0; cin.getline(s,1001); for(i=0;s[i]!='\0';i++){ a[s[i]]+=1; } for(j='a';j<='z';j++){ if(a[j]>max){ max=a[j]; m=j; } } cout<<m<<" "<<max; return 0; }