From 9e09c03363d6cab857cca9a81f0849bffe677932 Mon Sep 17 00:00:00 2001 From: Florian Burgener <florian.burgener@etu.hesge.ch> Date: Tue, 25 Jan 2022 14:27:42 +0100 Subject: [PATCH] Validation ex1 --- ex1/ex1.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ex1/ex1.c b/ex1/ex1.c index 0dd6493..5b34c5e 100644 --- a/ex1/ex1.c +++ b/ex1/ex1.c @@ -9,17 +9,15 @@ * */ -#include <math.h> -#include <stdbool.h> #include <stdint.h> #include <stdio.h> #include <stdlib.h> -#include <string.h> int main() { int32_t values_length = 8; int32_t values[values_length]; + // Reading of the 8 input values. for (int32_t i = 0; i < values_length; i += 1) { int32_t value; scanf("%d", &value); @@ -29,6 +27,7 @@ int main() { int32_t drop_count = 0; int32_t drop_sum = 0; + // Count the number of drops and calculate the sum of the drops. for (int32_t i = 1; i < values_length; i += 1) { if (values[i] < values[i - 1]) { drop_count += 1; -- GitLab