Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
138257 hjx433 字母概率 C++ Accepted 1 MS 268 KB 313 2025-11-24 12:36:02

Tests(1/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",s/strlen(a)); getchar(); } return 0; }