View Code of Problem 70

#include<stdio.h>

int main()
{
    int money;
    while(scanf("%d", &money)!=EOF){
    
    if(money<=100000){
        printf("%d\n", money/10);
    } else if(money<=200000){
        printf("%d\n", (money-100000)*75/1000 + 100000/10);
    } else if(money<=400000){
        printf("%d\n", (money-200000)*5/100 + 100000*175/1000);
    } else if(money<=600000){
        printf("%d\n", (money-400000)*3/100 + 100000*175/1000 + 200000 * 5/100);
    } else if(money<=1000000){
        printf("%d\n", (money-600000)*15/1000 + 200000*8/100 + 100000*175/1000);
    } else {
        printf("%d\n", (money-1000000)*1/100 + 400000*15/1000 + 200000*8/100 + 100000*175/1000);
    }
}
    return 0;
}

Double click to view unformatted code.


Back to problem 70