View Code of Problem 9

#include <iostream>
using namespace std;
char a[10000];
int main(void){
	int n;
	int k=0;
	while(cin>>n){
		int temp=n;
		int total=0;
		int WWW=0;
	while(n--){
		cin>>a;
		if(a[0]=='L')	total+=15;
		else if(a[0]=='A'&&temp>=10) {total+=60; } 
		else if(a[0]=='S') total+=20;
		else if(a[0]=='P'&&a[1]=='l') total+=5;
		else if(a[0]=='P'&&a[1]=='r') total+=8;
		else 
			total+=10;
	}
	cout<<"Case #"<<++k<<":"<<total<<endl;
}
	return 0;
}

Double click to view unformatted code.


Back to problem 9