View Code of Problem 9

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

Double click to view unformatted code.


Back to problem 9