You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
67 lines
1.7 KiB
67 lines
1.7 KiB
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");
|
|
}
|