| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 130092 | huangyifeng2 | 字母概率 | C++ | Output Limit Exceeded | 16 MS | 276 KB | 473 | 2025-09-07 15:59:22 |
#include<iostream> #include<string> #include<iomanip> using namespace std; int main() { string str; char ch; int num = 0; while (true) { cin >> ch >> str; int a = str.length(); for (int i = 0; i < a; i++) { if (ch == str[i] || toupper(ch) == str[i]) { num++; } } cout << fixed << setprecision(5); cout << (float)num / a << endl; } }