# include <iostream>
# include <cstdio>
using namespace std;
int main()
{
int n,c=0,r=0,f=0,tol=0;
cin>>n;
for(int i=0;i<n;++i)
{ int x;
char ch;
cin>>x>>ch;
tol+=x;
if(ch=='C') c+=x;
else if(ch=='R') r+=x;
else f+=x;
}
printf("Total: %d animals\n",tol);
printf("Total coneys: %d\n",c);
printf("Total rats: %d\n",r);
printf("Total frogs: %d\n",f);
printf("Percentage of coneys: %.2lf %%\n",(double)c/tol*100);
printf("Percentage of rats: %.2lf %%\n",(double)r/tol*100);
printf("Percentage of flogs: %.2lf %%\n",(double)f/tol*100);
return 0;
}
有大佬帮忙看看哪里错了吗?
718 718
啊啊啊 感谢 看了半个多小时
最后一行是frogs.