Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
101565 李禹宸 统计字符数量 C++ Accepted 1 MS 272 KB 313 2024-12-15 14:47:48

Tests(10/10):


Code:

#include <iostream> using namespace std; int main(){ char s1[1000],s,n; int i=0,max=-2e9,a[26]={0};//97 cin.getline(s1,1000); while(s1[i]!='\0'){ n=s1[i]; a[n-97]++; i++; } for(int i=0;i<=25;i++){ if(a[i]>max){ max=a[i]; n=char(i+97); } } cout<<n<<" "<<max; return 0; }