#include <stdio.h>
void Main ()
{
int g1,g2,g3,r1,r2,r3,n;
int m=0;
Float Ave;
int grade[3][3]; Let's say there are three of students
while (m<=2)
{
printf ("Please enter the school number as");
printf ("%d students ' scores (subjects in front) \ n", m);
scanf ("%d%d%d", &g1,&g2,&g3);
if (0<=g1&&g1<=100&&0<=g2&&g2<=100&&0<=g3&&g3<=100)
{
GRADE[M][3]=G1;
GRADE[M][3]=G2;
GRADE[M][3]=G3;
m++;
}
Else
{
printf ("Input error, please re-enter \ n");
}
}
end:printf ("Please enter the number of the study to be queried \ n");
scanf ("%d", &n);
if (n>=0&&n<=2)
{
R1=GRADE[N][3];
R2=GRADE[N][3];
R3=GRADE[N][3];
Ave= (R1+R2+R3)/3;
if (r1+r2+r3>270)
printf ("Enter the number according to the requirements, average divided into%f\n", ave);
else if (r1>95&&r2>95&&r3>75)
printf ("Enter the number according to the requirements, average divided into%f\n", ave);
else if (r1=100&&r2>=80&&r3>=80)
printf ("Enter the number according to the requirements, average divided into%f\n", ave);
else if (r2=100&&r1>=80&&r3>=80)
printf ("Enter the number according to the requirements, average divided into%f\n", ave);
Else
printf ("The input number does not meet the requirements \ n");
Goto end;
}
Else
{
printf ("Input error, please re-enter \ n");
Goto end;
}
}
In fact, the fourth day of learning C has written most
The fifth day spent almost an afternoon perfecting it.
The original request is
One of the two doors subjects, enter the study number,
1: Achieve a total score greater than 270,
2, two doors subjects is greater than 95, the other door is not less than 75,
3, there is a door subjects 100, the other not less than 80 points,
Judge a number that satisfies one of three conditions and outputs an average of
First C language code