learning-cc4e

Solution to https://cc4e.com/. If you copy these you're not right in the head.
git clone https://kaka.farm/~git/learning-cc4e
Log | Files | Refs

solution.c (349B)


      1 #include "stdio.h"
      2 
      3 main () {
      4   int scanned, number_of_numbers = 0;
      5   double input_number, total, average;
      6   while ((scanned = scanf("%lf", &input_number)) != EOF) {
      7     total += input_number;
      8     ++number_of_numbers;
      9   }
     10   average = total / number_of_numbers;
     11   printf("The total is: %.1f\n", total);
     12   printf("The average is: %.1f\n", average);
     13 }