Skip to content

Commit

Permalink
Solve Taxes in c
Browse files Browse the repository at this point in the history
  • Loading branch information
deniscostadsc committed Sep 20, 2024
1 parent c70b703 commit 1f0e3bc
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions solutions/beecrowd/1051/1051.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#include <stdio.h>

int main() {
float s;

scanf("%f", &s);

if (s <= 2000.0) {
printf("Isento\n");
} else if (s <= 3000.0) {
printf("R$ %.2f\n", (s - 2000.0) * 0.08);
} else if (s <= 4500.0) {
printf("R$ %.2f\n", 1000.0 * 0.08 + (s - 3000.0) * 0.18);
} else {
printf(
"R$ %.2f\n", 1000.0 * 0.08 + 1500.0 * 0.18 + (s - 4500.0) * 0.28);
}

return 0;
}

0 comments on commit 1f0e3bc

Please sign in to comment.