fork download
  1. #include <stdio.h>
  2. #include <stdarg.h>
  3.  
  4. float multiMin(int num, ...) {
  5. va_list lista;
  6. va_start(lista, num);
  7. float min = va_arg(lista, double);
  8. for (int i = 1; i < num; i++) {
  9. float item = va_arg(lista, double);
  10. if (item < min)
  11. min = item;
  12. }
  13. va_end(lista);
  14. return min;
  15. }
  16.  
  17. int main(void) {
  18. float a, b, c, d;
  19. scanf("%f\n%f\n%f\n%f\n", &a, &b, &c, &d);
  20. printf("%f", (a + b + c + d - multiMin(4, a, b, c, d)) / 3);
  21. }
  22.  
  23. //https://pt.stackoverflow.com/q/57242/101
Success #stdin #stdout 0s 4552KB
stdin
3
5
8
10
stdout
7.666667