| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 138250 | hjx433 | 字母概率 | C++ | Accepted | 0 MS | 204 KB | 334 | 2025-11-24 12:24:53 |
#include<stdio.h> #include<string.h> int main(){ //freopen("test.in","r",stdin); char s,str[210]; while(scanf("%c %s",&s,str)!=EOF){ int num=0; int len=strlen(str); for(int i=0;i<len;i++){ if(str[i]==s||str[i]==s+32||str[i]==s-32) num++; } printf("%.5f\n",1.0*num/len); getchar(); } return 0; }