Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- float func(int notas[10][3], int i)
- {
- float soma;
- int a;
- for(a=0; a<3; a++)
- {
- soma += notas[i][a];
- }
- return soma/3;
- }
- int main()
- {
- char nomes[10][100];
- int notas[10][3];
- int i, a=0, b = 0, j;
- char xxx[100];
- printf("Digite o nome do aluno :\n");
- for (i=0; i<5; i++)
- {
- gets(nomes[i]);
- for (j=0; j<3; j++)
- {
- printf("Digite a %d nota\n", j+1);
- scanf("%d",¬as[i][j]);
- a = func(notas, i);
- if (a > b)
- {
- b = a;
- xxx = nomes[i];
- }
- }
- printf("MAIOR NOTA = %d DO ALUNO %c ", b, xxx);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement