#include<iostream> #include<cmath> #include<string> #include<algorithm> using namespace std; int main() { int n,k=1; while (cin >> n) { cout << "Case #" << k << ": "; if (n <= 3) cout<< 5 << endl; else { float sum = 5 + (n - 3)*1.5; if (n % 2 == 0) sum += 0.5; cout << sum << endl; } k++; } } |
Double click to view unformatted code.