Run ID:151656

提交时间:2026-04-17 10:28:07

#include<bits/stdc++.h> using namespace std; int main(){ string a; char b; while(cin>>b>>a){ int len=a.size(); if(b>='A'&&b<='Z') b=b+32; for(int j=0;j<len;j++){ if(a[j]>='A'&&a[j]<='Z'){ a[j]=a[j]+32; } } int s=0; for(int j=0;j<len;j++){ if(a[j]==b){ s++; } } printf("%.5lf\n",double(s)/len); } return 0; }