View Code of Problem 9

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

Double click to view unformatted code.


Back to problem 9