Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
158995 格林老师 字母概率 C++ Output Limit Exceeded 5 MS 280 KB 397 2026-08-24 14:32:39

Tests(0/1):


Code:

#include <bits/stdc++.h> using namespace std; int main() { while(true){ string s; char c; cin>>c; cin>>s; char cc=tolower(c); int sumi=0; for (int i=0;i<s.size();i++){ if (tolower(s[i])==cc){ sumi++; } } printf("%.5lf\n",sumi*1.0/s.size()); } return 0; }