diff --git a/ex1/ex1.c b/ex1/ex1.c index 0dd64932c9df3b59e22d99096e6b83eba9acb83c..5b34c5e9b939279a3a8866387ad92f22a9ed7d2a 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;