View Code of Problem 9

#include<stdio.h>
#include<string.h>
int main(){
	int n;
	char s1[100],s2[100];
		int flag;
		int goal;
		int sum;
		int k;
	while(scanf("%d",&n)!=EOF) {
		k++;
		getchar();
		goal=0; 
		for(int i=0;i<n;i++){
				scanf("%s %s",s1,s2);
				getchar();
				if(s1[0]=='P'&&s1[1]=='l'){
					goal+=5; 
				}  if(s1[0]=='P'&&s1[1]=='r'){
					goal+=8; 
				}  if(s1[0]=='A'){
					goal+=10; 
					flag=1;
				}  if(s1[0]=='L'){
					goal+=15; 
				}  if(s1[0]=='S'){
					goal+=20; 
				}
			
		}	
			if(n>=10&&flag==1){
			goal+=50;}
			
		
			printf("Case #%d:%d\n",k,goal);
			goal=0;
			
		
		
		
}
	return 0;
}

Double click to view unformatted code.


Back to problem 9