|
|
|
|
#include<stdio.h>
|
|
|
|
|
#include<string.h>
|
|
|
|
|
#include<stdlib.h >
|
|
|
|
|
|
|
|
|
|
struct
|
|
|
|
|
{
|
|
|
|
|
char id[20];
|
|
|
|
|
char name[20];
|
|
|
|
|
char _class[5];
|
|
|
|
|
char online[1];
|
|
|
|
|
float _fee;
|
|
|
|
|
float begin_hour;
|
|
|
|
|
float begin_min;
|
|
|
|
|
float end_hour;
|
|
|
|
|
float end_min;
|
|
|
|
|
}student[15];
|
|
|
|
|
|
|
|
|
|
void dengji();
|
|
|
|
|
void shangji();
|
|
|
|
|
void fee();
|
|
|
|
|
void xiugai();
|
|
|
|
|
void chaxun();
|
|
|
|
|
void tuichu();
|
|
|
|
|
|
|
|
|
|
int i,k,m;
|
|
|
|
|
|
|
|
|
|
int main(void)
|
|
|
|
|
{
|
|
|
|
|
int select;
|
|
|
|
|
do
|
|
|
|
|
{
|
|
|
|
|
printf("*****************<2A><>ӭ<EFBFBD><D3AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>շѹ<D5B7><D1B9><EFBFBD>ϵͳ*****************\n");
|
|
|
|
|
printf(" 1.ѧ<><D1A7><EFBFBD>Ǽ<EFBFBD>\n");
|
|
|
|
|
printf(" 2.ѧ<><D1A7><EFBFBD>ϻ<EFBFBD>ʱ<EFBFBD><CAB1>\n");
|
|
|
|
|
printf(" 3.ѧ<><D1A7><EFBFBD>»<EFBFBD>ʱ<EFBFBD>估<EFBFBD><E4BCB0><EFBFBD><EFBFBD>\n");
|
|
|
|
|
printf(" 4.<2E><EFBFBD>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD>Ϣ\n");
|
|
|
|
|
printf(" 5.<2E><>ѯѧ<D1AF><D1A7><EFBFBD><EFBFBD>Ϣ\n");
|
|
|
|
|
printf(" 6.<2E>˳<EFBFBD>ϵͳ\n");
|
|
|
|
|
printf("*****************<2A><>ӭ<EFBFBD><D3AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>շѹ<D5B7><D1B9><EFBFBD>ϵͳ*****************\n");
|
|
|
|
|
printf(" <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1>:");
|
|
|
|
|
scanf("%d",&select);
|
|
|
|
|
switch(select)
|
|
|
|
|
{
|
|
|
|
|
case 1: getchar();
|
|
|
|
|
dengji();
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 2: getchar();
|
|
|
|
|
shangji();
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 3:getchar();
|
|
|
|
|
fee();
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 4:getchar();
|
|
|
|
|
xiugai();
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 5:getchar();
|
|
|
|
|
chaxun();
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 6:tuichu();
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:break;
|
|
|
|
|
}
|
|
|
|
|
system("cls");
|
|
|
|
|
}while(select!=6);
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void dengji() //ѧ<><D1A7><EFBFBD><EFBFBD>Ϣ//
|
|
|
|
|
{
|
|
|
|
|
static int j=0;
|
|
|
|
|
system("cls");
|
|
|
|
|
printf("****************ѧ<><D1A7><EFBFBD><EFBFBD>Ϣ<EFBFBD>Ǽ<EFBFBD>****************\n");
|
|
|
|
|
for(i=j;i<15;i++)
|
|
|
|
|
{
|
|
|
|
|
char c;
|
|
|
|
|
printf("<EFBFBD>༶:");
|
|
|
|
|
gets(student[i]._class);
|
|
|
|
|
printf("ѧ<EFBFBD><EFBFBD>:");
|
|
|
|
|
gets(student[i].id);
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>:");
|
|
|
|
|
gets(student[i].name);
|
|
|
|
|
printf("<EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>룿(<28><><EFBFBD><EFBFBD>Y<EFBFBD><59>N)");
|
|
|
|
|
scanf("%c",&c);
|
|
|
|
|
if(c=='N'||c=='n')
|
|
|
|
|
{
|
|
|
|
|
j=i+1;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
getchar();
|
|
|
|
|
printf("\n");
|
|
|
|
|
}
|
|
|
|
|
if(i==15)
|
|
|
|
|
printf("¼<EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void shangji() //<2F>ϻ<EFBFBD>//
|
|
|
|
|
{
|
|
|
|
|
char _id[20];
|
|
|
|
|
system("cls");
|
|
|
|
|
printf("****************<2A>ϻ<EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>Ǽ<EFBFBD>****************\n");
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϻ<EFBFBD>ѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD>:");
|
|
|
|
|
gets(_id);
|
|
|
|
|
for(i=0;i<15;i++)
|
|
|
|
|
{
|
|
|
|
|
if(strcmp(_id,student[i].id)==0)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD>ϻ<EFBFBD>ʱ<EFBFBD><EFBFBD>:(<28><>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD>12<31><32>00)");
|
|
|
|
|
scanf("%f<><66>%f",&student[i].begin_hour,&student[i].begin_min);
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD>........\n");
|
|
|
|
|
system("pause");
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(i==15)
|
|
|
|
|
{
|
|
|
|
|
printf(" <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣδ¼<CEB4><C2BC>!\n");
|
|
|
|
|
printf(" <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>........\n");
|
|
|
|
|
system("pause");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void fee() //<2F>»<EFBFBD>//
|
|
|
|
|
{
|
|
|
|
|
char _id[20];
|
|
|
|
|
system("cls");
|
|
|
|
|
printf("****************<2A>»<EFBFBD>ʱ<EFBFBD>估<EFBFBD><E4BCB0><EFBFBD>õǼ<C3B5>****************\n");
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ÿСʱ5Ԫ\n");
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>»<EFBFBD>ѧ<EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD>:");
|
|
|
|
|
gets(_id);
|
|
|
|
|
for(i=0;i<15;i++)
|
|
|
|
|
{
|
|
|
|
|
if(strcmp(_id,student[i].id)==0)
|
|
|
|
|
{
|
|
|
|
|
if(!(student[i].begin_hour&&student[i].begin_min))
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>δ<EFBFBD>ϻ<EFBFBD>!\n");
|
|
|
|
|
system("pause");
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
printf("<EFBFBD>»<EFBFBD>ʱ<EFBFBD><EFBFBD>:(<28><>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD>12<31><32>00)");
|
|
|
|
|
scanf("%f<><66>%f",&student[i].end_hour,&student[i].end_min);
|
|
|
|
|
student[i]._fee=(student[i].end_hour+student[i].end_min/60-student[i].begin_hour-student[i].end_min/60)*5;
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ:%.1f\n",student[i]._fee);
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD>........\n");
|
|
|
|
|
system("pause");
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(i==15)
|
|
|
|
|
{
|
|
|
|
|
printf(" <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣδ¼<CEB4><C2BC>!\n");
|
|
|
|
|
printf(" <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>........\n");
|
|
|
|
|
system("pause");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void chaxun() //<2F><>ѯ//
|
|
|
|
|
{
|
|
|
|
|
char _id[20];
|
|
|
|
|
system("cls");
|
|
|
|
|
printf("*************************************ѧ<><D1A7><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>ѯ*************************************\n");
|
|
|
|
|
printf(" <20><><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1>\n");
|
|
|
|
|
printf(" 1<><31><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѯ\n");
|
|
|
|
|
printf(" 2<><32>ȫ<EFBFBD><C8AB><EFBFBD><EFBFBD>ѯ\n");
|
|
|
|
|
printf(" <20><><EFBFBD><EFBFBD><EFBFBD>룺");
|
|
|
|
|
scanf("%d",&k);
|
|
|
|
|
switch(k)
|
|
|
|
|
{
|
|
|
|
|
case 1:
|
|
|
|
|
getchar();
|
|
|
|
|
system("cls");
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѯѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD>ţ<EFBFBD>");
|
|
|
|
|
gets(_id);
|
|
|
|
|
for(i=0;i<15;i++)
|
|
|
|
|
{
|
|
|
|
|
if(strcmp(_id,student[i].id)==0)
|
|
|
|
|
{
|
|
|
|
|
system("cls");
|
|
|
|
|
printf("*************************************ѧ<><D1A7><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>ѯ*************************************\n");
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>:%s\t",student[i].name);
|
|
|
|
|
printf("<EFBFBD>༶:%s\t",student[i]._class);
|
|
|
|
|
printf("ѧ<EFBFBD><EFBFBD>:%s\t",student[i].id);
|
|
|
|
|
printf("<EFBFBD>ϻ<EFBFBD>ʱ<EFBFBD><EFBFBD>: %g:%g\t",student[i].begin_hour,student[i].begin_min);
|
|
|
|
|
printf("<EFBFBD>»<EFBFBD>ʱ<EFBFBD><EFBFBD>: %g:%g\t",student[i].end_hour,student[i].end_min);
|
|
|
|
|
printf("<EFBFBD>ϻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: %.1f\n",student[i]._fee);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(i==15)
|
|
|
|
|
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣδ¼<EFBFBD>룡\n");
|
|
|
|
|
printf("\n\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n\n");
|
|
|
|
|
system("pause");
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 2:
|
|
|
|
|
system("cls");
|
|
|
|
|
printf("*************************************ѧ<><D1A7><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>ѯ*************************************\n");
|
|
|
|
|
printf("<EFBFBD>༶\t\t");
|
|
|
|
|
printf("ѧ<EFBFBD><EFBFBD>\t\t");
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>\t\t");
|
|
|
|
|
printf("<EFBFBD>ϻ<EFBFBD>ʱ<EFBFBD><EFBFBD>\t");
|
|
|
|
|
printf("<EFBFBD>»<EFBFBD>ʱ<EFBFBD><EFBFBD>\t");
|
|
|
|
|
printf("<EFBFBD>ϻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\t");
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>״̬\n");
|
|
|
|
|
for(i=0;i<15;i++)
|
|
|
|
|
{
|
|
|
|
|
printf("%s\t\t",student[i]._class);
|
|
|
|
|
printf("%s\t\t",student[i].id);
|
|
|
|
|
printf("%s\t\t",student[i].name);
|
|
|
|
|
printf("%g:%g\t\t",student[i].begin_hour,student[i].begin_min);
|
|
|
|
|
printf("%g:%g\t\t",student[i].end_hour,student[i].end_min);
|
|
|
|
|
printf("%.1f\t\t",student[i]._fee);
|
|
|
|
|
if(student[i].begin_hour==0)
|
|
|
|
|
printf("δ<EFBFBD>ϻ<EFBFBD>");
|
|
|
|
|
else if(student[i].begin_hour!=0&&student[i].end_hour==0)
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
else if(student[i].begin_hour!=0&&student[i].end_hour!=0)
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
printf("\n");
|
|
|
|
|
}
|
|
|
|
|
printf("*************************************ѧ<><D1A7><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>ѯ*************************************\n");
|
|
|
|
|
printf("\n\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
system("pause");
|
|
|
|
|
getchar();
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void xiugai() //<2F><EFBFBD>//
|
|
|
|
|
{
|
|
|
|
|
char _id[20],name[20],banji[5];
|
|
|
|
|
int eh,em,n,bh,bm;
|
|
|
|
|
int m;
|
|
|
|
|
system("cls");
|
|
|
|
|
printf("****************<2A><EFBFBD>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD>Ϣ****************\n");
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD>ţ<EFBFBD>\n");
|
|
|
|
|
gets(_id);
|
|
|
|
|
for(i=0;i<15;i++)
|
|
|
|
|
{
|
|
|
|
|
if(strcmp(_id,student[i].id)==0)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD>Ҫ<EFBFBD>ĵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD>1<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 2<><32><EFBFBD>༶ 3<><33><EFBFBD>ϻ<EFBFBD>ʱ<EFBFBD><CAB1> 4<><34><EFBFBD>»<EFBFBD>ʱ<EFBFBD><CAB1> 5<><35>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ\n");
|
|
|
|
|
scanf("%d",&n);
|
|
|
|
|
switch(n)
|
|
|
|
|
{
|
|
|
|
|
case 1:
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>µ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:\n");
|
|
|
|
|
getchar();
|
|
|
|
|
gets(name);
|
|
|
|
|
strcpy(student[i].name,name);
|
|
|
|
|
system("pause");
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 2:
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>µİ༶:\n");
|
|
|
|
|
getchar();
|
|
|
|
|
gets(banji);
|
|
|
|
|
strcpy(student[i]._class,banji);
|
|
|
|
|
system("pause");
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 3:
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>µ<EFBFBD><EFBFBD>ϻ<EFBFBD>ʱ<EFBFBD><EFBFBD>:\n");
|
|
|
|
|
getchar();
|
|
|
|
|
scanf("%d:%d",&bh,&bm);
|
|
|
|
|
student[i].begin_hour=bh;
|
|
|
|
|
student[i].begin_min=bm;
|
|
|
|
|
system("pause");
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 4:
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>µ<EFBFBD><EFBFBD>»<EFBFBD>ʱ<EFBFBD><EFBFBD>:\n");
|
|
|
|
|
getchar();
|
|
|
|
|
scanf("%d:%d",&eh,&em);
|
|
|
|
|
student[i].end_hour=eh;
|
|
|
|
|
student[i].end_min=em;
|
|
|
|
|
student[i]._fee=(student[i].end_hour+student[i].end_min/60-student[i].begin_hour-student[i].end_min/60)*5;
|
|
|
|
|
system("pause");
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 5:
|
|
|
|
|
for(m=i+1;m<15;m++)
|
|
|
|
|
{
|
|
|
|
|
student[m-1]=student[m];
|
|
|
|
|
}
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD>ѳɹ<EFBFBD>ɾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD>");
|
|
|
|
|
system("pause");
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(i==15)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
|
|
|
|
|
system("pause");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void tuichu()
|
|
|
|
|
{
|
|
|
|
|
system("cls");
|
|
|
|
|
printf("*****************<2A><>лʹ<D0BB>û<EFBFBD><C3BB><EFBFBD><EFBFBD>շѹ<D5B7><D1B9><EFBFBD>ϵͳ*****************\n");
|
|
|
|
|
system("pause");
|
|
|
|
|
}
|