#include <iostream> #include <sstream> #include <stdio.h> #include <string> #include <math.h> #include <algorithm> #include <stdlib.h> #include <stack> #include <map> #include <set> #include <queue> using namespace std; int change(string a) { if(a=="Pleasant goat") return 5; else if(a=="Pretty goat") return 8; else if(a=="Athletic goat") return 10; else if(a=="Lazy goat") return 15; else return 20; } int main() { #ifdef ONLINE_JUDGE #else freopen("1.txt","r",stdin); #endif int n; int index=0; while(cin>>n) { getchar(); index++; bool flag=0; int ans=0; for(int i=0;i<n;i++) { string str; getline(cin,str); if(str=="Athletic goat") flag=1; ans+=change(str); } if(n<10) flag=0; if(flag==1) ans+=50; cout<<"Case #"<<index<<": "<<ans; cout<<endl; } return 0; } |
Double click to view unformatted code.