fork download
  1. #include <stdio.h>
  2. #include <limits.h>
  3. #define NUM 5
  4.  
  5. int main(){
  6. float notas[NUM];
  7. float maior = 0, menor = INT_MAX, media;
  8. for (int i = 0; i < NUM; i++) {
  9. scanf("%f", &notas[i]);
  10. maior = notas[i] > maior ? notas[i] : maior;
  11. menor = notas[i] < menor ? notas[i] : menor;
  12. media += notas[i];
  13. }
  14. media /= NUM;
  15. printf("%.1f %.1f %.1f\n\n", maior, menor, media);
  16. for (int i = 0; i < NUM; i++) printf("%.1f ", notas[i]);
  17. }
  18.  
  19. //https://pt.stackoverflow.com/q/157124/101
Success #stdin #stdout 0s 4324KB
stdin
5
3
7
8
2
stdout
8.0 2.0 5.0

5.0 3.0 7.0 8.0 2.0