Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
88551 王馨桐 统计字符数量 C++ Accepted 1 MS 272 KB 304 2024-08-19 11:57:58

Tests(10/10):


Code:

#include<bits/stdc++.h> using namespace std; char s[1001]; int t[128]; int main(){ cin >>s; int n=strlen(s); for(int i=0;i<=n-1; i++){ t[s[i]]++; } int ci=-2e9; char c; for(int i=97; i<=122; i++){ if(t[i]>ci){ ci=t[i]; c=i; } } cout <<c <<" " <<ci; return 0; }