View Code of Problem 118

#include <stdio.h>
#include <math.h>
int main(){
  float n;
  int num=0;
  float price;
  while (scanf("%f",&n)!=EOF){
    num++;
    if(n>0&&n<=3){
      price=5;
    }else{
      price=ceil((n-3)*1.5+5);
    }
    printf("Case #%d: %.0f\n",num,price);
   
    
  
  }


return 0;
}

Double click to view unformatted code.


Back to problem 118