#include <stdio.h>
#include <stdlib.h>
float calcularmedia(float n1,float n2,float n3, float me){
return(n1+n2*2+n3*3+me)/(float)7;
}
main()
{
int i;
float n1,n2,n3,me;
for(i=1;i<=5;i++){
do{
printf("Digite a Nota 1 do Aluno %i: ",i);
scanf("%f",&n1);
}while((n1<0)||(n1>10));
do{
printf("Digite a Nota 2 do Aluno %i: ",i);
scanf("%f",&n2);
}while((n2<0)||(n2>10));
do{
printf("Digite a Nota 3 do Aluno %i: ",i);
scanf("%f",&n3);
}while((n3<0)||(n3>10));
do{
me = ((n1 + n2 + n3)/3);
printf("\n");
if(me<=6){
printf("Media %6.2f \"REPROVADO\"",me);
}else{
printf("Media %6.2f \"APROVADO\"",me);
}
}while((me<0)||(me>10));
printf("\n");
printf("Media Aproveitamento Aluno %i = %6.2f\n",i,calcularmedia(n1,n2,n3,me));
printf("\n");
}
}