#include<iostream> #include<cstring> using namespace std; int main() { long int n; int t=0; string str1,str2; while(cin>>n) { t++; int sum=0,fyy=0; for(int i=0;i<n;i++) { cin>>str1>>str2; if(str1=="Pretty") sum=sum+8; else if(str1 =="Pleasant") sum=sum+5; else if(str1=="Athletic") {sum=sum+10;fyy++;} else if(str1=="Lazy") sum=sum+15; else if(str1=="Slow") sum=sum+20; } if(n>=10&&fyy!=0) sum=sum+50; cout<<"case #"<<t<<": "<<sum<<endl; } } |
Double click to view unformatted code.