提交时间:2019-12-28 09:06:47
运行 ID: 4030
#include<iostream> using namespace std; int main(){ char n; char qq[398]; while((scanf("%c%*c%s%*c",&n,qq)!=EOF)){ int i=0,urmaker=0; if(n>='a') n=n-32; while(qq[i]!='\0'){ if(qq[i]>='a') qq[i]=qq[i]-32; if(qq[i]==n) urmaker++; i++; } printf("%.5f\n",urmaker*1.0/i); } return 0; }