提交时间:2019-12-28 21:20:12
运行 ID: 4052
#include<iostream> int main() { char c,a[201]; while(scanf("%c%*c%s%*c",&c,a)!=EOF) { int i=0,sum=0; if(c>='a') c=c-32; while(a[i]!='\0') { if(a[i]>='a') a[i]=a[i]-32; if(a[i]==c) sum++; i++; } printf("%.5f\n",sum*1.0/i); } return 0; }