这种写法初学者可能比较容易看懂
有问题欢迎指出【鞠躬】
include[HTML_REMOVED]
int main()
{
double n1,n2,n3,n4,x,y,z;
scanf(“%lf%lf%lf%lf”,&n1,&n2,&n3,&n4);
x = (n12+n23+n3*4+n4)/(2+3+4+1);
printf(“Media: %.1lf\n”,x);
if(x>=7.0)
printf(“Aluno aprovado.\n”);
else if(x<5.0)
printf(“Aluno reprovado.\n”);
else if(x>=5.0 && x<7.0)
{
printf(“Aluno em exame.\n”);
scanf(“%lf”,&y) ;
printf(“Nota do exame: %.1lf\n”,y);
z = (x+y)/2;
if(z>=5.0)
printf(“Aluno aprovado.\n”);
else
printf(“Aluno reprovado.\n”);
printf(“Media final: %.1lf”,z);
}
return 0;
}