提交时间:2019-12-26 23:24:00

运行 ID: 3901

#include<iostream> using namespace std; 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("%.5lf\n",sum*1.0/(i-1)); } return 0; }