C language design
Users questions: Our class has 23 students, make a directory, enter a student's name, the output corresponding to his telephone number. To 5, come to you to answer .
Experts answer: student management system to change to change their facing. # Include "stdio.h" # include "st ring.h #defineN2structstudent{longnum;charname[20];charsex;intchinese;intmath;intenglish;};structstu +) (Printf ("Enter Student ID: * n"); scanf ("% ld", & stu [i]. Num); printf ("Enter Name: * n"); scanf ("% s", stu [i]. name); getchar (); printf ("Enter Gender: * n"); scanf ("% c", & stu [i]. sex); printf ("Please enter the Chinese achievement: * n"); scanf ("% d", & stu [i ]. chinese); printf (" Please enter the math: * n "); scanf ("% d ", & stu [i]. Math); printf (" Please enter the English results: * n "); scanf ("% d ", & stu [i]. english);)) voidfun2 () ( nucleus; for (i = 0; i N: i + +) (printf ("% LD * t% s * t% c * n", Stu [i]. num, Stu [i]. name, Stu [i]. sex); printf ("% d% d * t * t% d * n ", Stu [i]. Chinese, stu [i]. Math, stu [i]. English);)) voidfun3 () (charname [20]; intk, f = 0; printf (" Please enter your looking for Name: );gets(name);for(k=0;k 2;k++)if(strcmp(name,stu[k].name)==0){printf( %ld,%s,%c,%d,%d,%d ,stu[k].num , Stu [k]. Name, stu [k]. Sex, stu [k]. Chinese, stu [k]. Math, stu [k]. English); f = 1;) if (f = 0) printf ( "Wood has this people ~ ~ ~ TOT") ;) Voidfun4 () (intk; charnewname [20]; printf ("Please enter the student's name! * N"); gets (newname); printf ("All students recorded as: * n"); fun2 (); f or (k = 0; k 2; k + +) if (strcmp (newname, stu [k]. name) == 0) (printf ("You selected students: * n"); printf ("% ld,% s,% c,% d,% d,% d ", s to [k]. num, stu [k]. name, students [k]. sex, stu [k]. Chinese, stu [k]. math, stu [k]. English) stu [k]. num = stu [k +1]. num; strcpy (stu [k]. name, stu [k +1]. name) stu [k]. fri = stu [k +1]. fri; stu [k]. chinese = stu [k +1]. chinese ; stu [k]. mat h = stu [k +1]. math; stu [k]. english = stu [k +1]. english;) printf ("student records have been removed, !");} voidmain () (printf ("*** ******** *********************************** N "); printf ("******** ***** student performance management process ***************** n "); printf ("***************** ***************************** n "); printf ("************** ********************* Welcome! * n "); printf ("****************** ************* producer :******* n "); printf ("******************** * Xingxiang Yun, Zhang Jian, the Health and sword, Gong Wei * n "); printf (" 1 .............................. Add * n "); printf (" 2 .............................. show * n "); printf (" 3 .............................. query * n "); printf (" 4 .......... .................... delete * n "); printf (" Please enter your operation to be carried out: * n "); scanf ("% d ", & choose ); while (choose! = 1 & & choose! = 2 & & choose! = 3 & & choose! = 4) (printf ("Digital Multi also table by mistake acridine ~ ~ ~ ~ and then all over it ~ look at strategic ^_^"); scanf (" % d ", & choose);) while (choose == 1 ** choose == 2 ** choose == 3 ** choose == 4) (switch (choose) (case1: fun1 (); break; case2: fun2 (); break; case3: fun3 (); break; case4: fun4 (); break;) printf ("Please enter your conduct of operations: * n"); scanf ("% d", & choose);))