Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Untitled

a guest Jun 24th, 2018 67 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. float func(int notas[10][3], int i)
  4. {
  5.  
  6.     float soma;
  7.     int a;
  8.     for(a=0; a<3; a++)
  9.     {
  10.         soma += notas[i][a];
  11.     }
  12.  
  13.     return soma/3;
  14.  
  15. }
  16.  
  17. int main()
  18. {
  19.     char nomes[10][100];
  20.     int notas[10][3];
  21.     int i, a=0, b = 0, j;
  22.     char xxx[100];
  23.  
  24.  
  25.     printf("Digite o nome do aluno :\n");
  26.     for (i=0; i<5; i++)
  27.     {
  28.         gets(nomes[i]);
  29.         for (j=0; j<3; j++)
  30.         {
  31.             printf("Digite a %d nota\n", j+1);
  32.             scanf("%d",&notas[i][j]);
  33.             a = func(notas, i);
  34.             if (a > b)
  35.             {
  36.                 b = a;
  37.  
  38.                 xxx = nomes[i];
  39.             }
  40.  
  41.         }
  42.  
  43. printf("MAIOR NOTA = %d DO ALUNO %c ", b, xxx);
  44.  
  45.  
  46.     }
  47.  
  48.     return 0;
  49. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top