Thursday, August 4, 2016

UVA 12555 - Baby Me

#include <bits/stdc++.h>
#define FAST ios_base::sync_with_stdio(0)
using namespace std;
int main()
{
    FAST;
    double a , b , t,kase = 0;
    string s="";
    cin>>t;
    while(t--){
        cin>>a>>s;
        b = s.size() > 3 ?  s[3] - '0' : 0;
        cout << "Case " << ++kase << ": " << a * 0.5 + b * 0.05 << '\n';
    }
    return 0;
}

No comments:

Post a Comment