diff --git a/学生机房收费管理系统.cpp b/学生机房收费管理系统.cpp new file mode 100644 index 0000000..8e263b7 --- /dev/null +++ b/学生机房收费管理系统.cpp @@ -0,0 +1,282 @@ +#include +#include +#include + +struct time { + int hour; + int minute; +}; + struct Student { + long int xuehao; + char banji[10]; + char name[10]; + int time_hour; + int time_minute; + struct time begin,end; +} ; +struct Student student[30]; +static int i=0,j; +void save(); +void insert(); +void end_money(); +void delete_student(); +void select_xuehao(); +void select_name(); +void select_banji(); +void show(); +int main() { + int menu(); + int i; + for(;;) + { + printf("\t\t*******************˵**************\n"); + printf("\t\t\n"); + printf("\t\t\n"); + printf("\t\t***************շѹϵͳ*******\n"); + printf("\t\t\n"); + printf("\t\t\n"); + printf("\t\t1.###############ѧϢ:########\n"); + printf("\t\t2.#################ϻ:##########\n"); + printf("\t\t3.################ɾ:###########\n"); + printf("\t\t4.################ѧŲѯ:#########\n"); + printf("\t\t5.################༶ѯ:#########\n"); + printf("\t\t6.################ѯ:#########\n"); + printf("\t\t7.################ʾѧϢ:#######\n"); + printf("\t\t8.##################˳ϵͳ:#########\n"); + printf("\n\n\n\nڣ1-8֮ѡ:"); + scanf("%d",&i); + + switch(i) + { + case 1: + { + system("cls"); + insert(); + } + break; + case 2: + { + system("cls"); + end_money(); + } + break; + case 3: + { + system("cls"); + delete_student(); + } + break; + case 4: + { + system("cls"); + select_xuehao(); + } + break; + case 5: + { + system("cls"); + select_banji(); + } + break; + case 6: + { + system("cls"); + select_name(); + } + break; + case 7: + { + system("cls"); + show(); + } break; + case 8: + { + exit(0); + } + break; + } + } + printf("\n"); system("pause"); + + save(); + return 0; + +} +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"); + system("cls"); +} +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 delete_student() +{ + long int xuehao; + int m; + printf("ѧ:"); + scanf("%ld",&xuehao); + if(i==1) +{ + if(student[m].xuehao==xuehao) + printf("û!"); + } +else{ + for(m=0;m