commit
380fb65d7a
@ -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<student[m].begin.minute)
|
||||
{
|
||||
minute=student[m].end.minute+60
|
||||
-student[m].begin.minute;
|
||||
hour=student[m].end.hour-1-student[m].begin.hour;
|
||||
student[m].time_hour = hour;
|
||||
student[m].time_minute = minute;
|
||||
}
|
||||
else
|
||||
{
|
||||
minute=student[m].end.minute -student[m].begin.minute;
|
||||
hour=student[m].end.hour -student[m].begin.hour;
|
||||
student[m].time_hour = hour;
|
||||
student[m].time_minute = minute;
|
||||
|
||||
}
|
||||
if(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");
|
||||
}
|
Loading…
Reference in new issue