Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
138247 hjx433 字母概率 C++ Output Limit Exceeded 4 MS 276 KB 304 2025-11-24 12:15:08

Tests(0/1):


Code:

#include <bits/stdc++.h> using namespace std; int main() { int i,t; float s,n; char a[200],b; while (true) { cin>>b>>a; n=strlen(a); i=s=0; while (i<strlen(a)) { if (a[i]+32==b or a[i]-32==b or a[i]==b) s++; i++; } printf("%.5f\n",s/n); } return 0; }