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