Taxes | beecrowd | 1051 | C

* Problem Link: https://www.beecrowd.com.br/judge/en/problems/view/1051

* Solution:
#include <stdio.h>

int main() {
    float x,a,b,c;
    scanf("%f",&x);
    if(x<=2000.00){
        printf("Isento\n");
    }
    else if(x<=3000.00 && x>=2000.01){
        a=(x-2000.00)*0.08;
        printf("R$ %.2f\n",a);
    }
    else if(x<=4500.00 && x>= 3000.01){
        b=(1000.00*0.08)+((x-3000.00)*0.18);
        printf("R$ %.2f\n",b);
    }
    else if(x>=4500.01){
        c=(1000.00*0.08)+(1500.00*0.18)+((x-4500.00)*0.28);
        printf("R$ %.2f\n",c);
    }
    return 0;
}

Post a Comment

Post a Comment (0)

Previous Post Next Post