View Code of Problem 70

#include<stdio.h>
int main()
{
    int I;
    scanf("%d",&I);
	int bonus = 0;
	
	if(I<=100000){
		bonus=0.1*I;
	}else if(I>100000&&I<=200000){
		bonus = 0.1*100000+(I-10000)*0.075;
	}else if(I>200000&&I<=400000){
		bonus = 0.1*100000+100000*0.075+(I-200000)*0.05;
	}else if(I>400000&&I<=600000){
		bonus = 0.1*100000+100000*0.075+0.05*200000+(I-400000)*0.03;
	}else if(I>600000&&I<=1000000){
		bonus = 0.1*100000+100000*0.075+0.05*200000+0.03*200000+(I-6000000)*0.015;
	
	}else{
		bonus=100000*0.1+100000*0.075+200000*0.05+200000*0.03+400000*0.015+(I-1000000)*0.01;		
	}	
    printf("%d",bonus);
      
    return 0;  
} 

Double click to view unformatted code.


Back to problem 70