From c70b703cf3e3bf03dc83cadfef9966ac209adb64 Mon Sep 17 00:00:00 2001 From: Denis Costa Date: Thu, 19 Sep 2024 20:55:28 -0300 Subject: [PATCH] Solve Salary Increase in c --- solutions/beecrowd/1048/1048.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 solutions/beecrowd/1048/1048.c diff --git a/solutions/beecrowd/1048/1048.c b/solutions/beecrowd/1048/1048.c new file mode 100644 index 00000000..ad1b3c89 --- /dev/null +++ b/solutions/beecrowd/1048/1048.c @@ -0,0 +1,31 @@ +#include + +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; +}