Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
62503 彭慕允 统计字符数量 C++ Accepted 1 MS 280 KB 303 2023-12-24 10:59:06

Tests(10/10):


Code:

#include <bits/stdc++.h> using namespace std; int main() { int tong[128]={0}; char c[1001]; cin>>c; int n=strlen(c); for(int i=0;i<n;i++){ tong[c[i]]++; } int tt=0; for(int i=0;i<128;i++){ if(tong[i]>tong[tt]){ tt=i; } } cout<<(char)tt<<" "<<tong[tt]; }