UVA 12555 Solution

#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
using namespace std;

int main() {
    string s;
    int tc, a, b, c= 1;

    cin >> tc;
    while (tc--) {
        cin >> a >> s;
        b = s.length() > 3 ? (int) s[3] - '0' : 0;
        cout << "Case " << c++ << ": " << a * 0.5 + b * 0.05 << endl;
    }
    return 0;
}

Comments

Popular posts from this blog

Codeforces 698A - Vacations

UVA 11364: Parking -Solution

UVA 10550 - Combination Lock : Solution