Advertisement
pauloludewig

Untitled

Jun 1st, 2014
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6. float notas[10][3], medias[10];
  7. int i, j;
  8.  
  9. for(i=0; i<10; i++)
  10. {
  11. for(j=0; j<3; j++)
  12. {
  13. do
  14. {
  15. printf("digite a %d nota do %d aluno = ", j, i);
  16. scanf("%f", &notas[i][j]);
  17. } while (notas[i][j] < 0 || notas[i][j] > 10);
  18. }
  19. }
  20.  
  21. for(i=0; i<10; i++)
  22. {
  23. medias[i] = (notas[i][1] + notas[i][2] + notas[i][0])/3;
  24. }
  25.  
  26. for(i=0; i<10; i++)
  27. {
  28. printf("a media do %d aluno eh %.1f\n", i, medias[i]);
  29. }
  30.  
  31.  
  32. return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement