| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 80579 | 刘昊炜 | 统计字符数量 | C++ | Accepted | 1 MS | 280 KB | 347 | 2024-07-11 15:18:05 |
#include<iostream> #include<cstring> using namespace std; int main(){ char a[1000] = {}; int n[1000] = {}; cin >> a; int s; for(int i=0;i<strlen(a);i++){ s = a[i] - 96; n[s]++; } int mxx = 0; char mxxn; for(int i=0;i<=27;i++){ if(n[i] > mxx){ mxx = n[i]; mxxn = i+96; } } cout << mxxn << " " << mxx; }