Guest User

Untitled

a guest
Apr 21st, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. /*
  2. Autor: Alexandre Alkmim Chamon
  3. Data: 13/04/2018
  4. Descricao: calcula media de alunos direto de um arquivo
  5. */
  6.  
  7. #include <stdio.h>
  8.  
  9. int main(void) {
  10. //dicionario de dados
  11. int totalAlunos;
  12. float nota1, nota2, nota3;
  13.  
  14. //recebe o numero total de alunos
  15. scanf("%d", &totalAlunos);
  16.  
  17. //enquanto Alunos for > 0
  18. while (totalAlunos > 0){
  19. scanf("%f %f %f", &nota1, &nota2, &nota3); //le as 3 notas
  20. printf("%.1f\n", (nota1+nota2+nota3)/3); // imprime no arquivo
  21. totalAlunos--;
  22. }
  23.  
  24. return 0;
  25. }
Add Comment
Please, Sign In to add comment