Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
62507 张誉腾 统计字符数量 C++ Accepted 2 MS 272 KB 296 2023-12-24 11:02:39

Tests(10/10):


Code:

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