```cpp
include[HTML_REMOVED]
include[HTML_REMOVED]
using namespace std;
int main(){
int n,a,sum=0,c1=0,f1=0,r1=0;
char t,F,C,R;
cin>>n;
for(int i=1;i<=n;i++){
cin>>a>>t;
sum+=a;
if(t==’C’)//1.== 2.花括号不全
c1+=a;
else if(t==’F’)//==
f1+=a;
if(t==’R’)//==
r1+=a;
}
cout<<”Total: “<<sum<<” animals”<<endl;
cout<<”Total coneys: “<<c1<<endl;
cout<<”Total rats: “<<r1<<endl;
cout<<”Total frogs: “<<f1<<endl;
printf(“Percentage of coneys: %.2lf %\n”,(double)c1/sum100.0);//3.总数为sum不是一开始的a!!4.而且要把int 型计算结果转为double 才可以用double输出
printf(“Percentage of rats: %.2lf %\n”,(double)r1/sum100.0);
printf(“Percentage of frogs: %.2lf %\n”,(double)f1/sum*100.0);
return 0;
}