(1) according to the order of student number input n student's student id and result in the array a. [50] [2], and the output array. A,
Specify a student id, and (2) if the student id, in array a output shows the corresponding results; Otherwise output "without the student!" ,
CodePudding user response:
For reference, do you copy again, deepen the impression:# include & lt; stdio.h>
# define 50 M
# define N 2
Int main (int arg c, char * argv [])
{
Int stu [M] [N].
For (int I=0; iPrintf (" please enter the first % d student student number and grade: ", I + 1);
for(int j=0; jThe scanf (" % d ", & amp; Stu [I] [j]);
}
}
For (int I=0; iPrintf (" % d student student number and grade: ", I + 1);
for(int j=0; jPrintf (" % 5 d % c, "stu [I] [j], ((j==1)? '\ n' : '));
}
}
Int I, temp;
Printf (" please enter student id to query: ");
The scanf (" % d ", & amp; Temp);
for(i=0; iIf (* stu [I]==temp) break;
continue;
}
If (I==M) printf (" no this student! \ n ");
The else
Student id: printf (" % d: % d \ n ", stu [I] [0], stu [I] [1]).
system("pause");
return 0;
}