Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
101602 | 邹昊辰 | 统计字符数量 | C++ | Accepted | 1 MS | 272 KB | 337 | 2024-12-15 15:16:06 |
#include<iostream> using namespace std; int main() { char ch[1000]; int num[200]={0},max=0; cin.getline(ch,1000); for(int i=0;ch[i]!='\0';i++){ num[ch[i]]++; if(max <= num[ch[i]])max = num[ch[i]]; } for(char i='a';i<='z';i++){ if(max==num[i]){ cout<<i<<" "<<num[i]; return 0; } } return 0; }