View Code of Problem 9

#include <bits/stdc++.h>
using namespace std;
int main() {
    int n, cal = 1;
    while (scanf("%d", &n) != EOF) {
        int sum = 0;
        string s;
        for (int i = 0; i < 2 * n; i++) {
            cin >> s;
            if (n >= 10 && s == "Athletic")
                sum += 50;
            if (s == "Pleasant")
                sum += 5;
            if (s == "Pretty")
                sum += 8;
            if (s == "Athletic")
                sum += 10;
            if (s == "Lazy")
                sum += 15;
            if (s == "Slow")
                sum += 20;
        }
        cout << "Case #" << cal++ << ":" << " " << sum << endl;
    }
    return 0;
}

Double click to view unformatted code.


Back to problem 9