commit 523154d5e7e708b6ac3d1a714db3b9abd9e05a29 Author: 赵斌 <18408000326@stu.hut.edu.cn> Date: Sun Jan 13 17:40:28 2019 +0800 first commit diff --git a/机房收费管理系统(1)(1).cpp b/机房收费管理系统(1)(1).cpp new file mode 100644 index 0000000..1dd8d8f --- /dev/null +++ b/机房收费管理系统(1)(1).cpp @@ -0,0 +1,252 @@ +#include +#include +#include +struct time +{ + int hour; + int minute; +}; +struct STUDENT + { + char id[20]; + char theclass[20]; + char name[20]; + int time_hour; + int time_minute; + struct time begin,end; + }student[100]; + int n; +static int i=0; +void insert(); +void end_money(); +void select_id(); +void select_name(); +void select_class(); +int main() +{ + printf(" \n\n\n\n\n\n\n\t\t ĸﴺ紵أѧ!\n"); + printf(" \t\t*********************************************\n"); + printf(" \t\t*********ӭշѹϵͳ************\n"); + printf(" \t\t*********************************************\n"); + printf("\t\t------------------------------(ûң)"); + printf("\t\t\n 밴ҪӦԱ֤õû飡\n"); + system("pause"); + system("cls"); + int i; + for(;;) + { + printf(" \t\t*********************************\n"); + printf(" \t\t*********շϵͳ************\n"); + printf(" \t\t*********************************\n"); + printf(" 1.---------------ѧϢ:\n"); + printf(" 2.---------------:\n"); + printf(" 3.---------------ѧŲѯ:\n"); + printf(" 4.---------------༶ѯ:\n"); + printf(" 5.---------------ѯ:\n"); + printf(" 6.---------------˳ϵͳ:\n"); + printf("\n\n (1-6)ѡ:"); + printf("\n\n ܰʾ:ֻеѾ¼ϢܽŶ ף\n"); + scanf("%d",&i); + switch(i) + { + case 1:{ + system("cls"); + insert(); + }break; + case 2:{ + system("cls"); + end_money(); + }break;; + case 3:{ + system("cls"); + select_id(); + }break; + case 4:{ + system("cls"); + select_class(); + }break; + case 5:{ + system("cls"); + select_name(); + }break; + case 6:{ + printf(" ӭ´ι٣"); + return 0; + } + } + } + system("pause"); + return 0; + } + void insert() + { + printf("Ҫ¼Ϣѧ(0-100ڵ):"); + scanf("%d",&n); + for(int j=1;j<=n;j++) + { + printf("%dѧѧ:",j); + scanf("%s",&student[j-1].id); + printf("%dѧ:",j); + scanf("%s",&student[j-1].name); + printf("%dѧİ༶:",j); + scanf("%s",&student[j-1].theclass); + printf("%dѧϻʱ(12:00):",j); + scanf("%d:%d",&student[j-1].begin.hour,&student[j-1].begin.minute); + } + printf("˵\n") ; + system("pause"); + system("cls"); + } + void end_money() + { + int m,minute,hour; + char shuru[20]; + printf("Ҫ»ѧѧŻ:"); + scanf("%s",shuru); + for(m=0;m0) + { + hour=hour+1; + printf("ϻʱΪ:%d:%d \nΪ:%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); + } + } + else if(!strcmp(shuru,student[m].name)) + { + printf("%s»ʱ:",student[m].name); + scanf("%d:%d",&student[m].end.hour,&student[m].end.minute); + if(student[m].end.minute0) + { + hour=hour+1; + printf("ϻʱΪ:%d:%d \nΪ:%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); + } + } + } + printf("˵\n") ; + system("pause"); + system("cls"); + } + void select_id() + { + char id[20]; + int m; + printf("ѧѧ:"); + scanf("%s",id); + for(m=0;m