From 2db749566d59fc4a1973048efa2a299e43a9bb4b Mon Sep 17 00:00:00 2001 From: Denis Costa Date: Wed, 24 Jul 2024 10:10:29 -0300 Subject: [PATCH] Solve Interval in c --- solutions/beecrowd/1037/1037.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 solutions/beecrowd/1037/1037.c diff --git a/solutions/beecrowd/1037/1037.c b/solutions/beecrowd/1037/1037.c new file mode 100644 index 00000000..e05f6ebb --- /dev/null +++ b/solutions/beecrowd/1037/1037.c @@ -0,0 +1,21 @@ +#include + +int main() { + double n; + + while (scanf("%lf", &n) != EOF) { + if (n >= 0.0 && n <= 25.0) { + printf("Intervalo [0,25]\n"); + } else if (n > 25.0 && n <= 50.0) { + printf("Intervalo (25,50]\n"); + } else if (n > 50.0 && n <= 75.0) { + printf("Intervalo (50,75]\n"); + } else if (n > 75.0 && n <= 100.0) { + printf("Intervalo (75,100]\n"); + } else { + printf("Fora de intervalo\n"); + } + } + + return 0; +}