Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
62506 胡家豪 统计字符数量 C++ Accepted 1 MS 276 KB 325 2023-12-24 11:02:14

Tests(10/10):


Code:

#include <bits/stdc++.h> 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]]++; } int tt = 0; for(int i = 0;i < 128;i++){ if(tong[i] > tong[tt]){ tt = i; } } cout << (char)tt<<" "<<tong[tt]; return 0; }