Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
138251 hjx433 字母概率 C++ Output Limit Exceeded 0 MS 260 KB 303 2025-11-24 12:27:43

Tests(0/1):


Code:

#include <bits/stdc++.h> using namespace std; int main() { int i; float s; char a[200],b; while (scanf("%c %s",b,a)!=EOF) { 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",1.0*s/strlen(a)); } return 0; }