不是......为嘛啊?为啥只有五十分

tctm114 2023-07-22 22:26:57 4

#include <bits/stdc++.h> using namespace std; int a[200]; string s; int main() { cin >> s; for (int i = 0; i < s.size(); i++) { a[s[i]]++; } int ma = 97; for (int i = 98; i <= 122; i++) { if (a[i] >= a[ma]) { ma = i; } } char c = ma; cout << c; return 0; }

{{ vote && vote.total.up }}

共 5 条回复

zxy140718
zxy140718
CPP 刷题王

再简单排版

CPP 刷题王
#include <bits/stdc++.h> using namespace std; int a[200]; string s; int main() { cin >> s; for (int i = 0; i < s.size(); i++) { a[s[i]]++; } int ma = 97; for (int i = 98; i <= 122; i++) { if (a[i] >= a[ma]) { ma = i; } } char c = ma; cout << c; return 0; }
CPP 刷题王

代码前+ ```cpp

代码后+ ```