diff --git a/j1.cpp b/j1.cpp new file mode 100644 index 0000000..a08dfee --- /dev/null +++ b/j1.cpp @@ -0,0 +1,89 @@ +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"); +} +void select_banji() { + char banji[10]; + int m; + printf("请输入班级:"); + scanf("%s",banji); + for(m = 0; m < i; m++) + { + if(!strcmp(banji,student[m].banji)) { + 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",student[m].time_hour,student[m].time_minute); + } + else if( m == i) + { + printf("没有该生记录:\n"); + } + }save(); + printf("\n"); system("pause"); + system("cls"); +}