fork(1) download
  1. #include <stdio.h>
  2. int main() {
  3. double x, max, min, sum;
  4. scanf("%lf", &x);
  5. for(max = min = sum = x; EOF != scanf("%lf", &x); sum += x)
  6. {
  7. if (max < x) max = x;
  8. else if (min > x) min = x;
  9. }
  10. printf("Max value %g\nMin value %g\nSum %g\n", max, min, sum);
  11. }
Success #stdin #stdout 0s 3344KB
stdin
1 2.3 7 14
stdout
Max value 14
Min value 1
Sum 24.3