parent
7681a396b0
commit
4dfff61c02
Binary file not shown.
@ -1,30 +1,39 @@
|
||||
#include "mysyslib.h"
|
||||
|
||||
char mainMenu() {
|
||||
char out[4][8] = {"Input","Output","Order","Quit"};
|
||||
for(int i=1;i<5;i++){
|
||||
int mainMenu(ss *stu) {
|
||||
char out[6][8] = {"input","delete","select","order","output","quit"};
|
||||
for(int i=1;i<7;i++){
|
||||
for(int j=0;j<30;j++){
|
||||
printf(" ");
|
||||
}
|
||||
printf("%d.%s\n",i,out[i-1]);
|
||||
}
|
||||
char ipt;
|
||||
scanf("%c",&ipt);
|
||||
int ipt;
|
||||
scanf("%d",&ipt);
|
||||
switch(ipt){
|
||||
case 'i':
|
||||
case 1:
|
||||
printf("You are trying to Input info\n");
|
||||
input(stu); //录入学生信息
|
||||
break;
|
||||
case 'o':
|
||||
printf("You are trying to Output info\n");
|
||||
case 2:
|
||||
printf("You are trying to Delete info\n");
|
||||
cancel(stu); //删除学生信息
|
||||
break;
|
||||
case 3:
|
||||
printf("You are trying to Selete info\n");
|
||||
break;
|
||||
case 'm':
|
||||
case 4:
|
||||
printf("You are trying to Make things ordered\n");
|
||||
break;
|
||||
case 'q':
|
||||
case 5:
|
||||
printf("You are trying to Output info\n");
|
||||
allPrint(stu); //输出所有学生信息
|
||||
break;
|
||||
case 6:
|
||||
printf("You are about to Quit\n");
|
||||
break;
|
||||
default:
|
||||
printf("Wrong input\n");
|
||||
}
|
||||
return ipt;
|
||||
return (ipt==6)?1:0;
|
||||
}
|
||||
|
@ -1,11 +1,15 @@
|
||||
#include "mysyslib.h"
|
||||
|
||||
void Print(Student*student){
|
||||
printf("%s,%s,%s,%.1lf,%.1lf,%.1lf,%.1lf\n",student->id,student->class,student->name,student-> score1,student->score2,student->score3,student->score);
|
||||
printf("%s,%s,%s,%.1lf,%.1lf,%.1lf,%.1lf\n",student->id,student->class,student->name,student->score1,student->score2,student->score3,student->score);
|
||||
}
|
||||
|
||||
void allPrint(ss*stu){
|
||||
if(stu->nums){
|
||||
for(int i = 0; i < stu->nums; ++i){
|
||||
Print(&stu->student[i]);
|
||||
}
|
||||
}else{
|
||||
printf("No data exist\n");
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in new issue