From 8c67f3ac73b4f654c1cc1eb3ccf39f285613ccc8 Mon Sep 17 00:00:00 2001 From: "2414352760@qq.com" <2414352760@qq.com> Date: Thu, 10 Jan 2019 20:25:36 +0800 Subject: [PATCH] 4 commit --- j1.cpp | 66 ---------------------------------------------------------- z1.c | 49 ++++++++++++++++++++++++++++--------------- 2 files changed, 32 insertions(+), 83 deletions(-) delete mode 100644 j1.cpp diff --git a/j1.cpp b/j1.cpp deleted file mode 100644 index c94b01b..0000000 --- a/j1.cpp +++ /dev/null @@ -1,66 +0,0 @@ -void end_money() { - int m,minute,hour; - char xuehao; - printf("请输入学号:"); - scanf("%ld",&xuehao); - for(m = 0; m < i; m++) - { - if(student[m].xuehao==xuehao) - { - printf("请输入%ld的下机时间:",xuehao); - scanf("%d:%d",&student[m].end.hour,&student[m].end.minute); - if(student[m].end.minute 0) - { - hour = hour + 1; - printf("上机时间为:%d:%d 费用为:%d",student[m].time_hour,student[m].time_minute,hour); - } - else { - printf("上机时间为:%d:%d\n 费用为:%d",student[m].time_hour,student[m].time_minute,hour); - } - } - } - save(); - printf("\n"); system("pause"); - system("cls"); -} -void select_xuehao() { - long int xuehao; - int m; - printf("请输入学号:"); - scanf("%ld",&xuehao); - for(m = 0; m < i; m++) - { - if(student[m].xuehao==xuehao) - { - printf("学号:%ld\t",student[m].xuehao); - printf(" 班级:%s\t",student[m].banji); - printf("姓名:%s\t",student[m].name); - printf(" 上机开始时间:%d:%d\t",student[m].begin.hour,student[m].begin.minute); - printf("上机结束时间:%d:%d\t",student[m].end.hour,student[m].end.minute); - printf("上机时间:%d:%d\n\t",student[m].time_hour,student[m].time_minute); - } - else if( m == i) - { - printf("没有该生记录:\n"); - } - } -save(); - printf("\n"); system("pause"); - system("cls"); -} diff --git a/z1.c b/z1.c index bcde513..ab4176a 100644 --- a/z1.c +++ b/z1.c @@ -1,19 +1,34 @@ -void insert() { - printf("请输入学号:"); - scanf("%ld",&student[i].xuehao); - - printf("请输入姓名:"); - scanf("%s",student[i].name); - - printf("请输入班级:"); - scanf("%s",student[i].banji); - - printf("请输入上机时间:"); - scanf("%d:%d",&student[i].begin.hour,&student[i].begin.minute); - i = i + 1; - printf("人数:%d",i); - j=i; - save(); - printf("\n"); system("pause"); +void select_name() +{char name[10]; +int m; +printf("请输入姓名:"); +scanf("%s",name); +for(m=0;m