#include
#include
#include
#include
#define N 20
#define M 100
struct student
{ char id[N];
char thecla[N];
char name[N];
char ontime[N];
}
student[M];
int n;
void addition()
{ int i;
cout
cin>>n;
for(i=1;i
{ cout
cin>>student[i-1].id;
cout
cin>>student[i-1].thecla;
cout
cin>>student[i-1].name;
cout
cin>>student[i-1].ontime;
cout
}
}
void calculate()
{ int hours;
char times[30];
time_t rawtime;
struct tm * timeinfo;
time ( &rawtime );
timeinfo = localtime(&rawtime );
strcpy(times,asctime(timeinfo));
cout
for(int i=1;i
{cout(times[14]-48)*10+times
[15])
hours=(times[11]-48)*10+times[12]-(student[i-1].ontime[0]-48)*10-student[i-1].on
time[1];
else
hours=(times[11]-48)*10+times[12]-(student[i-1].ontime[0]-48)*10-student[i-1].ontime[1]+1;
cout
}
}
void search()
{ int i,b,c,count;
do
{ char find[20];
cout
cin>>b;
switch(b)
{ case 1: count=PF_FLOATING_POINT_PRECISION_ERRATA; cout>find;
for(i=0;i
{ if (strcmp(student[i].id,find)==0)
{ count++;
if(count==PF_FLOATING_POINT_EMULATED)
cout
}
if(!count)
cout
goto A;
case 2: count=PF_FLOATING_POINT_PRECISION_ERRATA;
cout
cin>>find;
for(i=0;i
{ if (strcmp(student[i].thecla,find)==0)
{ count++;
if(count==PF_FLOATING_POINT_EMULATED)
cout
}
if(!count)
cout
goto A;
case 3: count=PF_FLOATING_POINT_PRECISION_ERRATA;
cout
cin>>find;
for(i=0;i
{
if (strcmp(student[i].name,find)==0)
{
count++;
if(count==PF_FLOATING_POINT_EMULATED)
cout
}
if(!count) cout
goto A;
case 4: count=PF_FLOATING_POINT_PRECISION_ERRATA;
cout
cin>>find;
for(i=0;i
{ if (strcmp(student[i].ontime,find)==0)
{ count++;
if(count==PF_FLOATING_POINT_EMULATED)
cout
}
if(!count)
cout
goto A;
default:cout
}
A:cout
cout
cin>>c;
}
while(c);
}
void menu()
{
cout
cout
}
void main()
{ system(\"color 5f\");
int a;
C:menu();
cin>>a;
switch(a)
{
case 0:cout
goto C;
case 2:calculate();
goto C;
case 3:search();
goto C; }}