View Code of Problem 118

#include<iostream>

using namespace std;

int main(){
    int n,k=1;
    double money=0;
    while(cin>>n){
          if(n<=3) cout<<"Case #"<<k++<<": "<<5<<endl;
          else{
              money=(n-3)*1.5+5;
              cout<<"Case #"<<k++<<": "<<(int)(money+0.5)<<endl;
          }
    }
    return 0;
}

Double click to view unformatted code.


Back to problem 118