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