fork download
  1. #include <stdio.h>
  2. int add(int a, int b, int u, int d, int e){
  3. int c;
  4. c=a+b+u+d+e;
  5. return c;}
  6. int main() {
  7. int one;
  8. scanf("%d", &one);
  9. int two;
  10. scanf("%d", &two);
  11. int three;
  12. scanf("%d", &three);
  13. int four;
  14. scanf("%d", &four);
  15. int five;
  16. scanf("%d", &five);
  17. int sum;
  18. sum= add(one, two, three, four, five);
  19. printf("%d", sum);
  20. printf("\n");
  21. float ar;
  22. ar =(sum/5);
  23. printf("%f", ar);
  24. printf("\n");
  25. if (one> two && three && four && five){
  26. printf("%d", one);
  27. }
  28. if (two> one && three && four && five){
  29. printf("%d", two);}
  30. if (three> two && one && four && five){
  31. printf("%d", three);
  32. }
  33. if (four> two && three && one && five){
  34. printf("%d", four);
  35. }
  36. if (five> two && three && four && one){
  37. printf("%d", five);
  38. }
  39. return 0;
  40. }
  41.  
Success #stdin #stdout 0s 4464KB
stdin
1 2 3 4 5
stdout
15
3.000000
2345