C++:学生勤務システム


#include 
#include 
#include 
using namespace std;  

//    
class time 
{
public: 
  time(int y=0,int m=0,int d=0) 
  {
	  year=y;month=m;day=d;
  } 
  ~time(){}
protected: 
	int year,month,day; 
}; 
 
 //    
 class xinxi:public time 
 { 
 public: 
	 xinxi(){ tiaoshu++;} 
	 ~xinxi(){tiaoshu--;} 
 void setname(char *n)
 {
	 strcpy(name,n);
 } 
 void settime(int y,int m,int d)
 {
	 year=y;month=m;day=d;
 } 
 void setqklx(char *qk)
 {
	 strcpy(queke,qk);
 } 
 void setjieci(char *jc)
 {
	 strcpy(jieci,jc);} 
 void setkechen(char *kc)
 {
	 strcpy(kechen,kc);
 } 
 char *getname()
 {
	 char *n;n=name;return n;
 } 
 char *getqklx()
 {
	 char *qk=queke;return qk;
 } 
 char *getjieci()
 {
	 char *jc;jc=jieci;return jc;
 } 
 char *getkechen()
 {
	 char *gk;gk=kechen;return gk;
 } 
 int *gettime(); 
 private: 
     char name[20];//   
     char jieci[3],kechen[10],queke[10]; 
     int tm[3]; 
  static int tiaoshu; 
 }; 
   
 int xinxi::tiaoshu=0; 
 
 int *xinxi::gettime() 
 {   int *t; 
     t=tm; 
  tm[0]=year; 
  tm[1]=month; 
  tm[2]=day; 
  return t; 
 } 

 //      
 class qk:public xinxi 
 {public: 
    qk(){kcshu++;} 
   ~qk(){kcshu--;} 
   int getrc(xinxi st1[],int n,int j); 
   char qkn[20];	//       
 
 private: 
   int renci; 
   static int kcshu;	//       
}; 
  
 int qk::kcshu=0; 
   
 int qk::getrc(xinxi st1[],int n,int j) 
 {   renci=0; 
      renci++; 
    for(int i=0;i>ch; 
  switch(ch) 
  {case 1: g=shuru(tl); break; 
  case 2: xiugai(tl,g); break; 
  case 3: chaxun(tl,qt); break; 
  case 4: tongji1(tl,qt); break; 
  case 5: tongji2(tl,qk); break; 
  case 6: exit(0); 
  } 
 } 
  return 0; 
}     
    
   //     
     void caidan() 
{ 
		 
cout<>name; 
  st1[q].setname(name); 
   cout<>kechen; 
  st1[q].setkechen(kechen); 
  cout<>y>>m>>d; 
  st1[q].settime(y,m,d); 
  cout<>queke; 
  st1[q].setqklx(queke); 
  cout<>jieci; 
  st1[q].setjieci(jieci); 
  cout<>a; 
 }while(a=='y'); 
  return q+1; 
} 
     //     
  void xiugai(xinxi st1[],int n) 
  {    
      int k=1,j=0,a[10]; 
   int flgh; 
         int h; 
        while(k==1)    
  { cout<>name; 
    flgh=0; 
    for(int i=0;i>b; 
        if(b==1) 
     { cout<>y>>m>>d; 
    st1[i].settime(y,m,d); 
	 } 
     else if(b==2) 
     {cout<>jieci; 
      st1[i].setjieci(jieci); 
     } 
     else if(b==3) 
     {cout<>kechen; 
     st1[i].setkechen(kechen); 
     } 
              else if(b==4) 
     { cout<>queke; 
     st1[i].setqklx(queke); 
     }  
     flgh=1;j++; 
   }while(b<1||b>4); 
    if(flgh==0) 
    {cout<>k; 
    } 
     else 
     {cout<>k; 
     } 
   } 
            for(int i=0;i>name;  
  int i=0; 
  for(;i>n; 
   } 
  for(int a=0;a>n; 
  } 
 }    
}    
     //                   
  void tongji1(xinxi st1[],qs qt1[]) 
 {   int d1=0,js=0; 
  xinxi min; 
  if(g==0) 
	  cout<