{
int num;
char C;
scanf(“%d %c”,&num,&C);
if(C==’C’)c+=num;
if(C==’R’)r+=num;
if(C==’F’)f+=num;
}
printf("Total: %d animals\n",c+r+f);
printf("Total coneys: %d\n",c);
printf("Total rats: %d\n",r);
printf("Total frogs: %d\n",f);
printf("Percentage of coneys: %.2f %%\n",(double)c/(c+r+f)*100);
printf("Percentage of rats: %.2f %%\n",(double)r/(c+r+f)*100);
printf("Percentage of frogs: %.2f %%\n",(double)f/(c+r+f)*100);
//注意等号和C,R,F符号小写还是大写