#include<stdio.h> #include<string.h> int main() { int num,i,j,sorce,z=1; char sheep[10000][20]; while(scanf("%d",&num)!=EOF) { getchar(); j=0; sorce=0; for(i=0;i<num;++i) { gets(sheep[i]); if(strcmp(sheep[i],"Pleasant goat")==0) sorce=sorce+5; else if(strcmp(sheep[i],"Pretty goat")==0) sorce=sorce+8; else if(strcmp(sheep[i],"Athletic goat")==0) { sorce=sorce+10; j=1; } else if(strcmp(sheep[i],"Lazy goat")==0) sorce=sorce+15; else if(strcmp(sheep[i],"Slow goat")==0) sorce=sorce+20; } if(j==1&&num>=10) sorce=sorce+50; printf("Case #%d: %d\n",z,sorce); ++z; } } |
Double click to view unformatted code.