View Code of Problem 70

#include<stdio.h>
#include<string.h>
int main(){
	char a[100],c;
	int i,len=0,k,j=1,s[100],f1,f2,s1,s2,m1,m2,x,y;
	scanf("%d",&x);
	if(x<=100000){
		k=x*0.1;
	
	}
	if(x>100000&&x<=200000){
		k=100000*0.1+(x-100000)*0.075;
	
	}
	if(x>200000&&x<=400000){
		k=100000*0.1+100000*0.075+(x-200000)*0.05;
	
	}
	if(x>400000&&x<=600000){
		k=100000*0.1+100000*0.075+200000*0.05+(x-400000)*0.03;
	
	}
	if(x>600000&&x<=1000000){
		k=100000*0.1+100000*0.075+200000*0.05+200000*0.03+(x-600000)*0.015;
	
	}
	if(x>1000000){
			k=100000*0.1+100000*0.075+200000*0.05+200000*0.03+400000*0.015+(x-1000000)*0.015;
	
	}
	printf("%d",k);
	return 0;
}

Double click to view unformatted code.


Back to problem 70