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

Tests(1/1):


Code:

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