View Code of Problem 70

#include<stdio.h>
int main()
{
	int a,m;
	scanf("%d",&a);
	if(a<=100000) m=a*0.1;
	if(a>100000&&a<=200000) m=100000*0.1+(a-100000)*0.075;
	if(a>200000&&a<=400000) m=100000*0.1+100000*0.75+(a-200000)*0.05;
	if(a>400000&&a<=600000) m=100000*0.1+100000*0.75+200000*0.05+(a-400000)*0.03;
    if(a>600000&&a<=1000000) m=100000*0.1+100000*0.75+200000*0.05+200000*0.03+(a-600000)*0.015;
	if(a>1000000) m=100000*0.1+100000*0.75+200000*0.05+200000*0.03+400000*0.015+(a-1000000)*0.01;

	printf("%d",m);

}

Double click to view unformatted code.


Back to problem 70