A C language "new hand" is asking for heroes to evaluate

xiaoxiao2021-03-13  169

Struct student {char Num [6]; char name [8]; int score [4]; float aver;} stu [5]; main () {INT I, J, SUM, K, T; strunt student * p; For (i = 0; i <5; i ) {printf ("/ ninput scorers of student% d: / n", i 1); Printf ("no .:"); scanf ("% s", STU [i] .num); Printf ("Name:"); scanf ("% s", stu [i] .name); for (j = 0; j <3; j ) {printf ("score% d: ", J 1); scanf ("% d ", & stu [i] .score [j]);}} for (i = 0; i <5; i ) {SUM = 0; for (j = 0; J <3; J ) SUM = STU [i] .score [J]; STU [I] .aver = sum / 3.0;} for (i = 0; i <4; i ) {p = stu; k = i For (J = I 1; J <5; J ) IF (STU [J] .aver> Stu [k] .aver) k = j; if (k! = I) {p [5] = P [ I]; p [i] = p [k]; p [k] = p [5];}} printf ("no. name math computer electric average / n"); for (p = stu; p

转载请注明原文地址:https://www.9cbs.com/read-129122.html

New Post(0)