Skip to content

Commit

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

int main() {
float n;

while (scanf("%f", &n) != EOF) {
if (n <= 400.0) {
printf("Novo salario: %.2f\n", n * 1.15);
printf("Reajuste ganho: %.2f\n", n * 1.15 - n);
puts("Em percentual: 15 %");
} else if (n <= 800.0) {
printf("Novo salario: %.2f\n", n * 1.12);
printf("Reajuste ganho: %.2f\n", n * 1.12 - n);
puts("Em percentual: 12 %");
} else if (n <= 1200.0) {
printf("Novo salario: %.2f\n", n * 1.10);
printf("Reajuste ganho: %.2f\n", n * 1.10 - n);
puts("Em percentual: 10 %");
} else if (n <= 2000.0) {
printf("Novo salario: %.2f\n", n * 1.07);
printf("Reajuste ganho: %.2f\n", n * 1.07 - n);
puts("Em percentual: 7 %");
} else {
printf("Novo salario: %.2f\n", n * 1.04);
printf("Reajuste ganho: %.2f\n", n * 1.04 - n);
puts("Em percentual: 4 %");
}
}

return 0;
}

0 comments on commit c70b703

Please sign in to comment.