#include<iostream> #include<vector> #include<algorithm> #include<string> using namespace std; int main() { int n; int k = 0; while (cin >> n) { k++; int sum = 0; int flag = 0; for (int i = 0; i < n; i++) { string str, str2; cin >> str >> str2; if (str[0] == 'P' && str[1] == 'l') sum += 5; if (str[0] == 'P' && str[1] == 'r') sum += 8; if (str[0] == 'A') { flag = 1; sum += 10; } if (str[0] == 'L') sum += 15; if (str[0] == 'S') sum += 20; } if (n >= 10 && flag == 1) sum += 50; cout << "Case #" << k << ": " << sum << endl; } } |
Double click to view unformatted code.