View Code of Problem 9

#include<iostream>
#include<stdio.h>
#include<bits/stdc++.h>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<cstdlib>
using namespace std;
int main(){
    int num, now=1,temp;
    while(cin>>num){
            temp=num;
       int flag=0,cj=0;
        string yang,a;
        while(num--){
            cin>>yang>>a;
            if(yang=="Pleasant")
                cj+=5;
            else if(yang=="Pretty")
                cj+=8;
            else if(yang=="Athletic")
            {cj+=10;flag=1;}
            else if(yang=="Lazy")
                cj+=15;
            else cj+=20;
        }
        if(temp>=10&&flag==1)
            cj+=50;
        cout<<"Case #"<<now++<<": "<<cj<<endl;
    }
return 0;
}

Double click to view unformatted code.


Back to problem 9