Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
150877 成书骏 统计字符数量 C++ Accepted 2 MS 280 KB 557 2026-04-01 20:35:41

Tests(10/10):


Code:

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int b[26]={0},max=-1; char a[1000],c; cin>>a; for(int i=0;a[i]!='\0';i++){ b[a[i]-'a']++; for(int i=0;a[i]!='\0';i++){ if(b[a[i]-'a']>max){ max=b[a[i]-'a']; c=a[i]; } } } cout<<c<<" "<<max; return 0; }