Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
6234 邓小龙 统计字符数量 C++ Accepted 0 MS 268 KB 600 2025-01-14 15:02:49

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 t[125]={};//97号之前的桶不用,97-122 char ch[1001]; cin>>ch; for(int i=0;ch[i]!='\0';i++){ t[ch[i]]++; } int _max=-1,t_num=0; for(int i=97;i<=122;i++){ if(t[i]>_max) { _max=t[i]; t_num=i; } } cout<<char(t_num)<<" "<<_max; return 0; }