View Code of Problem 70

#include<stdio.h>
#include <string.h>
void main()
{
int i;
double j;
scanf("%d",&i);
if(i<=100000)
j=i*0.1;
if(i>100000&&i<=200000)
j=10000+(i-100000)*0.075;
if(i>200000&&i<=400000)
j=10000+7500+(i-200000)*0.05;
if(i>400000&&i<=600000)
j=17500+10000+(i-400000)*0.03;
if(i>600000&&i<=1000000)
j=27500+6000+(i-600000)*0.015;
if(i>1000000)
j=27500+6000+6000+(i-1000000)*0.01;
printf("%d",(int)j);
}

Double click to view unformatted code.


Back to problem 70