GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — URI/1094.c at master · sarkerrabi/URI Expand file tree/ Copy path1094.cMore file actions 33 lines (31 loc) · 728 Bytes / Copy path1094.cFile metadata and controls33 lines (31 loc) · 728 Bytes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 #include<stdio.h> int main(){ int i,N,x,co=0,ra=0,sa=0,total; char a; float coP,raP,saP; scanf("%d",&N); for(i=1;i<=N;i++){ scanf("%d %c",&x,&a); if(a=='C'){ co=co+x; } if(a=='R'){ ra=ra+x; } if(a=='S'){ sa=sa+x; } } total=sa+ra+co; coP=((float)co*100)/total; saP=((float)sa*100)/total; raP=((float)ra*100)/total; printf("Total: %d cobaias\n",total); printf("Total de coelhos: %d\n",co); printf("Total de ratos: %d\n",ra); printf("Total de sapos: %d\n",sa); printf("Percentual de coelhos: %.2f %%\n",coP); printf("Percentual de ratos: %.2f %%\n",raP); printf("Percentual de sapos: %.2f %%\n",saP); return 0; } |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |