sửa lỗi dùm tui


Diễn đàn chia sẻ kiến thức, kinh nghiệm về IT và cuộc sống!
 
Trang ChínhGalleryTìm kiếmLatest imagesĐăng kýĐăng Nhập
Top posters
Sakura (1124)
sửa lỗi dùm tui Vote_lcapsửa lỗi dùm tui Voting_barsửa lỗi dùm tui Vote_rcap 
hotboy (705)
sửa lỗi dùm tui Vote_lcapsửa lỗi dùm tui Voting_barsửa lỗi dùm tui Vote_rcap 
Già Làng (373)
sửa lỗi dùm tui Vote_lcapsửa lỗi dùm tui Voting_barsửa lỗi dùm tui Vote_rcap 
con_ca_nho90 (289)
sửa lỗi dùm tui Vote_lcapsửa lỗi dùm tui Voting_barsửa lỗi dùm tui Vote_rcap 
that_true (154)
sửa lỗi dùm tui Vote_lcapsửa lỗi dùm tui Voting_barsửa lỗi dùm tui Vote_rcap 
theanhkkt (143)
sửa lỗi dùm tui Vote_lcapsửa lỗi dùm tui Voting_barsửa lỗi dùm tui Vote_rcap 
phamay (137)
sửa lỗi dùm tui Vote_lcapsửa lỗi dùm tui Voting_barsửa lỗi dùm tui Vote_rcap 
lovelonelyman (134)
sửa lỗi dùm tui Vote_lcapsửa lỗi dùm tui Voting_barsửa lỗi dùm tui Vote_rcap 
o0ovioletstaro0o (128)
sửa lỗi dùm tui Vote_lcapsửa lỗi dùm tui Voting_barsửa lỗi dùm tui Vote_rcap 
stevenhung (122)
sửa lỗi dùm tui Vote_lcapsửa lỗi dùm tui Voting_barsửa lỗi dùm tui Vote_rcap 
Âm - Dương lịch
Clock
Logo
11TH02 Pro!
Liên kết
Tin tức 60s
Tin công nghệ
Thời sự 24h
Game Moblie

Share
 

 sửa lỗi dùm tui

Xem chủ đề cũ hơn Xem chủ đề mới hơn Go down 
Tác giảThông điệp
hotboy

sửa lỗi dùm tui Stars7
hotboy

Thú CƯng : sửa lỗi dùm tui Hippopotamus-icon
Nam Aries

Số bài viết : 705
Điểm : 1043
Được cảm ơn : 9
Ngày sinh : 21/03/1990
Tham gia ngày : 13/05/2010
Tuổi : 34
Đến từ : BDU

sửa lỗi dùm tui Empty
Bài gửiTiêu đề: sửa lỗi dùm tui   sửa lỗi dùm tui I_icon_minitime9/9/2010, 19:38

Code:
#include<iostream>
#include<string>
#include<vector>
using namespace std;
#define maxtq 5
#define maxhk 20
class nguoi
{
protected:
   char ten[30];   
   int gioi;//gioi tinh ||1.nam||2.nu
   char diachi[50];      
public:
   nguoi(char _ten[30],int _gioi,char _diachi[50])
   {   
      strcpy_s(ten,_ten);         
      strcpy_s(diachi,_diachi);      
      gioi=_gioi;
   }
   nguoi()
   {   
      strcpy_s(ten," ");         
      strcpy_s(diachi," ");
      gioi=1;               
   }
   nguoi(const nguoi &cp);
   virtual ~nguoi()
   {}
   nguoi operator =(const nguoi &bn);
   friend ostream & operator << (ostream &, nguoi ); 
   friend istream & operator >>(istream &, nguoi &);   
};
//////////////////////////////////////////////// HUONG DAN VIEN ////////////////////////////////////////////////////////////////////
class nhanvien:public nguoi
{
private:      
   char ID[10];//ma nhan vien    
   char ngoaingu[10];//trinh do ngoai ngu
   int kinhnghiem;//so nam kinh nghiem
   int tuoi;//Gioi han tuoi cua huong dan vien trong khoang 18->40      
   nguoi _nguoi;
public:
   nhanvien():nguoi()
   {
      strcpy_s(ID," ");      
      strcpy_s(ngoaingu," ");      
      kinhnghiem=0;   
      tuoi=1;
   }
   nhanvien(char ms[10],char nn[10],int _kn,int _ag,char _ten[30],int sex,char _dc[50]):nguoi(_ten,sex,_dc)
   {
      strcpy_s(ID,ms);      
      strcpy_s(ngoaingu,nn);
      kinhnghiem=_kn;
      tuoi=_ag;      
   }
   virtual ~nhanvien()
   {}
   nhanvien operator =(const nhanvien &bnv);   
   friend istream &operator>>(istream &,nhanvien &);
   friend ostream &operator<< (ostream &, nhanvien );
};

//////////////////////////////////////// HANH KHACH ///////////////////////////////////////////////////
class hanhkhach:public nguoi
{
private:
   char ID[10];//ma nhan vien
   char diadiem[50];   
   char quoctich[10];//trinh do ngoai ngu   
   int tuoi;//Gioi han tuoi cua huong dan vien trong khoang 18->40
   char dienthoai[20];   
   nguoi man;   
public:
   
   hanhkhach():nguoi()
   {
      strcpy_s(ID," ");      
      strcpy_s(quoctich," ");         
      tuoi=1;
      strcpy_s(dienthoai," ");
   }
   hanhkhach(char _ten[30],int _gioi,char _diachi[50],char _quoctich[10],int _tuoi,char _ID[10],char _dienthoai[20]):nguoi(_ten, _gioi,_diachi)
   {
      strcpy_s(ID,_ID);      
      strcpy_s(quoctich,_quoctich);   
      tuoi=_tuoi;
      strcpy_s(dienthoai,_dienthoai);
   }
   /*      
   hanhkhach(const hanhkhach &cpn):nguoi(cpn)
   {
      strcpy_s(ID,cpn.ID);
      strcpy_s(diadiem,cpn.diadiem);
      strcpy_s(quoctich,cpn.quoctich);   
      tuoi=cpn.tuoi;
      strcpy_s(dienthoai,cpn.dienthoai);
   }
   */
   virtual ~hanhkhach()
   {}
   hanhkhach operator =(const hanhkhach &bnv);      
   friend ostream &operator<< (ostream &, hanhkhach ); 
   friend istream &operator>>(istream &, hanhkhach &);   
   void nhap();
   void xuat();
};

////////////////////////////////////////// PHUONG TIEN ///////////////////////////////////////////////////////////////

//++++++++++++++++++++++++++++++++ OTO ++++++++++++++++++++++++++++++++++++++++
class oto
{
private:   
   char maxe[10];//ma so cua xe
   char soxe[10];//ban so xe   
public:
   oto()
   {
      strcpy_s(maxe," ");
      strcpy_s(soxe," ");         
   }
   virtual ~oto()
   {}
   friend ostream &operator <<(ostream &,oto);
   friend istream &operator >>(istream &,oto &);
   oto operator =(const oto &bo);   
};

//++++++++++++++++++++++++++++++++ MAY BAY++++++++++++++++++++++++++++++

class maybay
{
private:
   char mamb[10];//ma so cua may bay
   char macb[10];//ma chuyen bay   
   char hang[30];//hang hang khong      
public:
   maybay()
   {
      strcpy_s(mamb," ");
      strcpy_s(macb," ");
      strcpy_s(hang," ");      
   }
   virtual ~maybay()
   {}
   friend ostream &operator <<(ostream &,maybay);
   friend istream &operator >>(istream &,maybay &);
   maybay operator =(const maybay &bm);   
};

////////////////////////////////////////////////////////////////// DIEM DUNG /////////////////////////////////////////////

//+++++++++++++++++++++++++++++++++ KHACH SAN +++++++++++++++++++++++++++++
class khachsan
{
private:
   char diachi[50];
   char ten[20];
   int sao;//so sao cua khach san
public:
   khachsan()
   {
      strcpy_s(diachi," ");
      strcpy_s(ten," ");
      sao=0;
   }
   virtual ~khachsan(){}
   khachsan operator =(const khachsan &bk);
   friend istream & operator >> (istream &,khachsan &);
   friend ostream & operator << (ostream &,khachsan );
};

//++++++++++++++++++++++++++++++++++++++ NHA HANG +++++++++++++++++++++++++++++
class nhahang
{
private:
   char diachi[50];
   char ten[20];
   int sao;//so sao cua khach san
   char dacsan[20];
public:
   nhahang()
   {
      strcpy_s(diachi," ");
      strcpy_s(ten," ");
      sao=0;
      strcpy_s(dacsan," ");
   }
   virtual ~nhahang()
   {}
   nhahang operator =(const nhahang &bn);
   friend istream & operator >> (istream &,nhahang &);
   friend ostream & operator << (ostream &,nhahang );
   void nhap();
};

//////////////////////////////// THAM QUAN //////////////////////////////////////
class thamquan
{
private:
   char tendd[50];//ten dia diem tham quan
   nhahang _nhahang;
   khachsan _khachsan;
public:      
   thamquan()
   {      
      strcpy_s(tendd," ");
   }
   virtual ~thamquan(){}
   friend istream & operator >> (istream &,thamquan &);
   friend ostream & operator << (ostream &,thamquan );
   void nhap();
   void xuat();
};

////////////////////////////////////////////////////////////////////////////// TOUR /////////////////////////////////////////
class tour
{
private:
   nhanvien _nhanvien;
   oto _oto;
   //danh cho du lich nuoc ngoai
   maybay _maybaydi;//chuyen bay di
   maybay _maybayve;//chuyen bay ve
   char quocgia[20];//ten quoc gia se den
   int chonTour;//1.trong nuoc ||2.nuoc ngoai
   int soluonghk;//so luong hanh khach
   int sodd;//so dia diem tham quan cua Tour
   hanhkhach *_hanhkhach;
   thamquan *_thamquan;
   vector<tour> listtour;   
public:
   tour()
   {
      strcpy_s(quocgia," ");
      chonTour=1;
      soluonghk=0;
      sodd=0;         
   }
   friend istream & operator >> (istream &,tour &);
   friend ostream & operator << (ostream &,tour );
   void nhap();
   void xuat();
};

////////////////////////////////////////////////////////////////
nguoi::nguoi(const nguoi&cp)
{
   strcpy_s(diachi,cp.diachi);
   gioi=cp.gioi;
   strcpy_s(ten,cp.ten);
}

nguoi nguoi::operator =(const nguoi &bn)
{
   delete[]ten;
   strcpy_s(ten,bn.ten);
   delete[]diachi;
   strcpy_s(diachi,bn.diachi);
   gioi=bn.gioi;
   return *this;
}
istream &operator>>(istream &pin, nguoi &a)
{
   cin.ignore();
   cout<<"\n NHAP TEN:";
   cin.getline(a.ten,30);
sex:
   cout<<"\n GIOI TINH:(1.NAM||2.NU)";
   pin>>a.gioi;
   if(a.gioi!=1&&a.gioi!=2)
   {
      cout<<"\n\n\a\a GIOI TINH KHONG RO RANG:!!!!";
      goto sex;
   }
   cout<<"\n DIA CHI:";
   cin.ignore();
   cin.getline(a.diachi,50);
   return pin;
}
ostream &operator<<(ostream &pout,nguoi a)
{
   pout<<"\n TEN:         "<<a.ten;
   pout<<"\n DIA CHI:      "<<a.diachi;
   pout<<"\n GIOI TINH:   "<<a.gioi;
   return pout;
}

////////////////////////////////////////////////////HUONG DAN VIEN //////////////////////////////////////////
istream & operator >>(istream &pin,nhanvien &a)
{   
   pin>>a._nguoi;
   cin.ignore();
   cout<<"\n NHAP MA SO NHAN VIEN:";   
   cin.getline(a.ID,10);
age:
   cout<<"\n NHAP TUOI:";
   pin>>a.tuoi;
   if(a.tuoi<18||a.tuoi>40)
   {
      cout<<"\n\n\a\a Tuoi khong hop le:!!!";
      cout<<"\n Tuoi hop le phai nam trong khoang 18-40";
      goto age;
   }
   cout<<"\n TRINH DO NGOAI NGU:";
   cin.ignore();
   cin.getline(a.ngoaingu,10);
ex:
   cout<<"\n SO NAM KINH NGHIEM:";
   cin>>a.kinhnghiem;
   if(a.kinhnghiem>a.tuoi-18||a.kinhnghiem<0)
   {
      cout<<"\n\n\a\a So nam kinh nghiem khong hop le:!!!!";
      cout<<"\n So nam kinh nghiem phai nam trong khoang 0-> tuoi-18 (vi phai >= 18 tuoi moi duoc nhan)";
      goto ex;
   }
   return pin;
}
ostream & operator <<(ostream &pout,nhanvien a)
{
   pout<<a._nguoi;
   pout<<"\n MA SO NHAN VIEN: "<<a.ID;
   pout<<"\n TUOI         :  "<<a.tuoi;
   pout<<"\n TRINH DO NGOAI NGU: "<<a.ngoaingu;
   pout<<"\n SO NAM KINH NGHIEM: "<<a.kinhnghiem;
   return pout;
}
nhanvien nhanvien:: operator =(const nhanvien &bnv)
{
   delete[]ID;
   strcpy_s(ID,bnv.ID);
   delete[]ngoaingu;
   strcpy_s(ngoaingu,bnv.ngoaingu);
   tuoi=bnv.tuoi;
   kinhnghiem=bnv.kinhnghiem;
   return *this;
}

///////////////////////////////////////////////////////////////////////// HANH KHACH //////////////////////////////////////////////////////////////////////////

hanhkhach hanhkhach::operator =(const hanhkhach &bnv)
{   
   delete[]quoctich;
   strcpy_s(quoctich,bnv.quoctich);   
   tuoi=bnv.tuoi;
   delete[]dienthoai;
   strcpy_s(dienthoai,bnv.dienthoai);
   return *this;
}
ostream &operator<< (ostream &pout, hanhkhach a) 
{      
      pout<<a.man;      
      pout<<"\n  . Tuoi              :";pout.width(3);pout<<a.tuoi;   
      pout<<"\n  . Quoc tich        :";pout.width(3);pout<<a.quoctich;
      pout<<"\n  . CMND/PASSPORT    :";pout.width(3);pout<<a.ID;
      pout<<"\n  . Dien thoai lien he:";pout.width(3);pout<<a.dienthoai;
      
   return pout;
}

istream &operator>>(istream &pin, hanhkhach &a)
{      
      cin>>a.man;
      cout<<"\n  . CMND/PASSPORT: ";   
      cin.ignore();
      cin.getline(a.ID,10);
   tuoi:
      cout<<"\n  . Tuoi: ";
      cin>>a.tuoi;      
      if(a.tuoi<0)
      {
         cout<<"\n sax!!chua sinh ra ma biet di du lich rui:";
         goto tuoi;   
      }
      else if(a.tuoi>=110)
      {
         cout<<"\n Qua lon tuoi roi:";
         goto tuoi;
      }
      cout<<"\n  . Quoc tich: ";
      cin.ignore();      
      cin.getline(a.quoctich,10);
      cout<<"\n  .Dien thoai lien he:";
      cin.ignore();      
      cin.getline(a.dienthoai,20);   
   return pin;
}

void hanhkhach::xuat()
{
   vector<hanhkhach>::iterator iter;
   int count=0;
   for(iter=listhanhkhach.begin();iter!=listhanhkhach.end();++iter)
   {
      count++;
      cout<<"\n\n ++++++++++++ HANH KHACH THU "<<count<<" +++++++++++++++ \n\n";
      cout<<*iter;
   }
}
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++PHUONG TIEN ++++++++++++++++++++++++++++++++++++++++++++++++++++++++

//++++++++++++++++++++++++ OTO+++++++++++++++++++++++++++++++++++++++++++++++
oto oto::operator =(const oto &bo)
{
   strcpy_s(maxe,bo.maxe);
   strcpy_s(soxe,bo.soxe);   
   return *this;
}

ostream &operator <<(ostream &pout,oto a)
{
   pout<<"\n Ma so xe      : ";pout.width(3);pout<<a.maxe;
   pout<<"\n Bien kiem soat : ";pout.width(3);pout<<a.soxe;   
   return pout;
}
istream &operator >>(istream &pin,oto &a)
{
   cout<<"\n Ma so xe : ";
   cin.ignore();
   cin.getline(a.maxe,10);
   cout<<"\n Bien kiem soat : ";   
   cin.getline(a.soxe,10);   
   return pin;
}

//++++++++++++++++++++++++ MAY BAY ++++++++++++++++++++++++++

maybay maybay::operator =(const maybay &bm)
{
   strcpy_s(mamb,bm.mamb);
   strcpy_s(macb,bm.macb);
   strcpy_s(hang,bm.hang);      
   return *this;
}

ostream &operator <<(ostream &pout,maybay a)
{
   pout<<"\n Ma so may bay  : ";pout.width(3);pout<<a.mamb;
   pout<<"\n Ma chuyen bay  : ";pout.width(3);pout<<a.macb;
   pout<<"\n Hang hang khong : ";pout.width(3);pout<<a.hang;         
   return pout;
}
istream &operator >>(istream &pin,maybay &a)
{   
   cout<<"\n Ma so may bay : ";
   cin.ignore();
   cin.getline(a.mamb,10);
   cout<<"\n Ma chuyen bay : ";
   cin.getline(a.macb,10);   
   cout<<"\n Hang hang khong : ";
   cin.ignore();
   cin.getline(a.hang,30);   
   return pin;
}

//////////////////////////////////////////////////////////////// DIEM DUNG //////////////////////////////////////////////////

//+++++++++++++++++++++++++++++++++++ KHACH SAN ++++++++++++++++++++++++++++++++++++++

khachsan khachsan::operator =(const khachsan &bk)
{
   delete[]diachi;
   strcpy_s(diachi,bk.diachi);
   delete[]ten;
   strcpy_s(ten,bk.ten);
   sao=bk.sao;
   return *this;
}
istream & operator >> (istream &pin,khachsan &a)
{
   cout<<"\n NHAP TEN CUA KHACH SAN:";
   cin.getline(a.ten,20);
   cout<<"\n NHAP DIA CHI CUA KHACH SAN:";
   cin.ignore();
   cin.getline(a.diachi,50);
   cout<<"\n SO SAO:";
   pin>>a.sao;
   return pin;
}
ostream & operator << (ostream &pout,khachsan a)
{
   pout<<"\n TEN KHACH SAN: "<<a.ten;
   pout<<"\n DIA CHI      : "<<a.diachi;
   pout<<"\n CAP DO     : "<<a.sao<<" sao";
   return pout;
}

//+++++++++++++++++++++++++++++++++ NHA HANG ++++++++++++++++++++++++++++++++++

nhahang nhahang::operator =(const nhahang &bn)
{
   delete[]diachi;
   strcpy_s(diachi,bn.diachi);
   delete[]ten;
   strcpy_s(ten,bn.ten);
   sao=bn.sao;
   delete[]dacsan;
   strcpy_s(dacsan,bn.dacsan);
   return *this;
}
istream & operator >> (istream &pin,nhahang &a)
{
   cout<<"\n NHAP TEN CUA NHA HANG:";
   cin.getline(a.ten,20);
   cout<<"\n NHAP DIA CHI CUA NHA HANG:";
   cin.ignore();
   cin.getline(a.diachi,50);
   cout<<"\n SO SAO:";
   pin>>a.sao;   
   cout<<"\n DAC SAN:";
   cin.ignore();   
   cin.getline(a.dacsan,20);
   return pin;
}
ostream & operator << (ostream &pout,nhahang a)
{
   pout<<"\n TEN NHA HANG: "<<a.ten;
   pout<<"\n DIA CHI      : "<<a.diachi;
   pout<<"\n CAP DO     : "<<a.sao<<" sao";
   pout<<"\n DAC SAN     : "<<a.dacsan;
   return pout;
}

//////////////////////////////////////////////////////// THAM QUAN ///////////////////////////////////////////////////////

istream &operator>>(istream &pin,thamquan &a)
{
   cin.ignore();
   cout<<"\n TEN DIA DIEM THAM QUAN:";
   cin.getline(a.tendd,50);
   cout<<"\n ++++++++++++++++NHAP THONG TIN VỀ NHÀ HÀNG KHÁCH SẠN SE ĐẾN++++++++++++++++++++ \n\n";
   pin>>a._nhahang;
   cout<<"\n\n";
   pin>>a._khachsan;
   cout<<"\n\n";
   return pin;
}
ostream &operator<<(ostream &pout,thamquan a)
{
   pout<<"\n TEN DIA DIEM THAM QUAN: "<<a.tendd;
   pout<<"\n ++++++++++++++++THONG TIN VE NHA HANG KHACH SAN SE DEN++++++++++++++++++++ \n\n";
   pout<<a._nhahang;
   pout<<"\n\n";
   pout<<a._khachsan;
   pout<<"\n\n";
   return pout;
}
void thamquan::xuat()
{
   vector<thamquan>::iterator iter;
   int count=0;
   for(iter=listthamquan.begin();iter!=listthamquan.end();++iter)
   {
      count++;
      cout<<"\n\n ++++++++++++ DIEM THAM QUAN THU "<<count<<" +++++++++++++++ \n\n";
      cout<<*iter;
   }
}

///////////////////////////////////////////////////////////////// TOUR //////////////////////////////////////////////////////////
istream & operator >>(istream &pin,tour &a)
{   
   int chon;
tn:
   cout<<"\n BAN MUON TAO 1 TOUR TRONG NUOC HAY TOUR NUOC NGOAI (1.TRONG NUOC|2.NUOC NGOAI) : ";
   cin>>a.chonTour;
   if(a.chonTour!=1&&a.chonTour!=2)
   {
      cout<<"\n\n\a\a NHAP SAI NHAP LAI: \n";
      goto tn;
   }
   else
      if(a.chonTour==2)
      {
         cout<<"\n NHAP TEN QUOC GIA SE DEN:";
         cin.ignore();
         cin.getline(a.quocgia,20);
         cout<<"\n\n +++++++++++++++++++++++++++++++++++ NHAP THONG TINH CAC CHUYEN BAY ++++++++++++++++++++++++++++\n";
         cout<<"\n\n +++++++++++++++++++++++ CHUYEN BAY DI ++++++++++++++++++ \n";
         pin>>a._maybaydi;
         cout<<"\n\n +++++++++++++++++++++++ CHUYEN BAY VE ++++++++++++++++++ \n";
         pin>>a._maybayve;
      }   
   cout<<"\n\n +++++++++++++++++++++++++++++++++++ NHAP THONG TINH HANH KHACH ++++++++++++++++++++++++++++\n";
hk:
   cout<<"\n SO LUONG HANH KHACH MAC DINH LA 20 NGUOI !!!";
   cout<<"\n 1 .BAN MUON THAY DOI SO LUONG HANH KHACH (gioi han trong khoang 5->20) \n 2. GIU NGUYEN SO LUONG MAC DINH ";
   cout<<"\n\n CHON:";
   cin>>chon;
   if(chon!=1&&chon!=2)
   {
      cout<<"\n\n\a\a NHAP SAI NHAP LAI: \n";
      goto hk;
   }
   else
   {
      if(chon==1)
      {
sl:
         cout<<"\n NHAP SO LUONG HANH KHACH:";
         cin>>a.soluonghk;
         if(a.soluonghk<5||a.soluonghk>20)
         {
            cout<<"\a\a";
            goto sl;
         }
      }
      else
         a.soluonghk=20;
   }      
   
   a._hanhkhach=new hanhkhach[a.soluonghk];
   for(int i=0;i<a.soluonghk;i++)
   {      
      cin>>a._hanhkhach[i];
      
   }

   cout<<"\n\n +++++++++++++++++++++++++++++++++++ NHAP THONG TINH HUONG DAN VIEN ++++++++++++++++++++++++++++\n";
   pin>>a._nhanvien;
   cout<<"\n\n +++++++++++++++++++++++++++++++++++ NHAP THONG TINH OTO ++++++++++++++++++++++++++++\n";
   pin>>a._oto;   
   cout<<"\n\n +++++++++++++++++++++++++++++++++++ NHAP THONG TINH DIA DIEM THAM QUAN ++++++++++++++++++++++++++++\n";
TQ:
   cout<<"\n SO DIEM THAM QUAN MAC DINH LA 5 !!!";
   cout<<"\n 1 .BAN MUON THAY DOI SO DIEM THAM QUAN (gioi han trong khoang 1->5) \n 2. GIU NGUYEN SO DIEM THAM QUAN MAC DINH ";
   cout<<"\n\n CHON:";
   cin>>chon;
   if(chon!=1&&chon!=2)
   {
      cout<<"\n\n\a\a NHAP SAI NHAP LAI: \n";
      goto TQ;
   }
   else
   {
      if(chon==1)
      {   
dtq:
            cout<<"\n NHAP SO DIEM THAM QUAN :";
            cin>>a.sodd;   
            if(1>a.sodd||5<a.sodd)
               goto dtq;
         
      }
      else
         a.sodd=5;
   }   
  a._thamquan=new thamquan[a.sodd];
   for(int i=0;i<a.sodd;i++)
   {      
      cin>>a._thamquan[i];
      
   }
   return pin;
}
ostream & operator <<(ostream &pout,tour a)
{
   if(a.chonTour==2)
   {
      pout<<"\n QUOC GIA : "<<a.quocgia;
      pout<<"\n\n +++++++++++++++++++++++ CHUYEN BAY DI ++++++++++++++++++ \n";
      pout<<a._maybaydi;
      pout<<"\n\n +++++++++++++++++++++++ CHUYEN BAY VE ++++++++++++++++++ \n";
      pout<<a._maybayve;
   }   
   cout<<"\n\n +++++++++++++++++++++++++++++++++++ THONG TINH HUONG DAN VIEN ++++++++++++++++++++++++++++\n";
   pout<<a._nhanvien;
   cout<<"\n\n +++++++++++++++++++++++++++++++++++ THONG TINH OTO ++++++++++++++++++++++++++++\n";
   pout<<a._oto;
   cout<<"\n\n +++++++++++++++++++++++++++++++++++ THONG TINH HANH KHACH ++++++++++++++++++++++++++++\n";
   a._hanhkhach=new hanhkhach[a.soluonghk];
   for(int i=0;i<a.soluonghk;i++)   
      pout<<"\n"<<a._hanhkhach[i];
   cout<<"\n\n +++++++++++++++++++++++++++++++++++ THONG TINH DIEM THAM QUAN ++++++++++++++++++++++++++++\n";
   a._thamquan=new thamquan[a.sodd];
   for(int i=0;i<a.sodd;i++)   
      pout<<"\n"<<a._thamquan[i];
   return pout;
}
void tour::nhap()
{   
   tour a;
   cin>>a;
   listtour.insert(listtour.end(),a);   
}
void tour::xuat()
{
   vector<tour>::iterator iter;
   for(iter=listtour.begin();iter!=listtour.end();++iter)
      cout<<*iter;
}

int main()
{
   tour a;
   a.nhap();
   a.xuat();
}
Về Đầu Trang Go down
hotboy

sửa lỗi dùm tui Stars7
hotboy

Thú CƯng : sửa lỗi dùm tui Hippopotamus-icon
Nam Aries

Số bài viết : 705
Điểm : 1043
Được cảm ơn : 9
Ngày sinh : 21/03/1990
Tham gia ngày : 13/05/2010
Tuổi : 34
Đến từ : BDU

sửa lỗi dùm tui Empty
Bài gửiTiêu đề: Re: sửa lỗi dùm tui   sửa lỗi dùm tui I_icon_minitime9/9/2010, 19:39

ai rảnh coi dùm tui coi sai chỗ nào mà sao lúc nhập xong xuất ra thì có cái xuất cái không.
Về Đầu Trang Go down
hotboy

sửa lỗi dùm tui Stars7
hotboy

Thú CƯng : sửa lỗi dùm tui Hippopotamus-icon
Nam Aries

Số bài viết : 705
Điểm : 1043
Được cảm ơn : 9
Ngày sinh : 21/03/1990
Tham gia ngày : 13/05/2010
Tuổi : 34
Đến từ : BDU

sửa lỗi dùm tui Empty
Bài gửiTiêu đề: Re: sửa lỗi dùm tui   sửa lỗi dùm tui I_icon_minitime9/9/2010, 20:01

heheh cuối cùng cũng phát hiện 2 cái lỗi vô duyên trong hàm << Laughing

àh mà ai có ý tưởng nào để phát triển cái code này không
cần thêm chức năng nào nữa
gần tới ngày nộp rồi mà nhóm tui chỉ mới hoàn thành phần nhập xuất àh.bà con giúp dùm Very Happy
Về Đầu Trang Go down
Sakura

sửa lỗi dùm tui Stars7
Sakura

Thú CƯng : sửa lỗi dùm tui I-hate-Cats-icon
Nam Scorpio

Số bài viết : 1124
Điểm : 1688
Được cảm ơn : 35
Ngày sinh : 03/11/1990
Tham gia ngày : 16/03/2010
Tuổi : 33
Đến từ : Bình Dương
Ngề nghiệp : IT Student

sửa lỗi dùm tui Empty
Bài gửiTiêu đề: Re: sửa lỗi dùm tui   sửa lỗi dùm tui I_icon_minitime10/9/2010, 13:05

Thuòng thì có phần nhập xuất, xóa, sửa, tra cứu, sắp xếp, tour thì có phần thống kê theo năm tháng gì đó, thêm chút đồ họa nhìn cho bắt mắt và.. phần giới thiệu hoành tráng vào là OK! Hjhj! Không có mạng thật bất tiện, ra net bực thật!
Về Đầu Trang Go down
hotboy

sửa lỗi dùm tui Stars7
hotboy

Thú CƯng : sửa lỗi dùm tui Hippopotamus-icon
Nam Aries

Số bài viết : 705
Điểm : 1043
Được cảm ơn : 9
Ngày sinh : 21/03/1990
Tham gia ngày : 13/05/2010
Tuổi : 34
Đến từ : BDU

sửa lỗi dùm tui Empty
Bài gửiTiêu đề: Re: sửa lỗi dùm tui   sửa lỗi dùm tui I_icon_minitime10/9/2010, 13:56

àh ed chỉ tui cái phần đọc ghi file đi
sao tui ghi thì nó báo lỗi (do là private với protected của lớp nên nó k cho truy cập vào)
z có cách nào không
Về Đầu Trang Go down
lovelonelyman

Member Năng Động


Member Năng Động
lovelonelyman

Nam Cancer

Số bài viết : 134
Điểm : 180
Được cảm ơn : 9
Ngày sinh : 15/07/1990
Tham gia ngày : 30/04/2010
Tuổi : 33
Đến từ : Thai Binh

sửa lỗi dùm tui Empty
Bài gửiTiêu đề: Re: sửa lỗi dùm tui   sửa lỗi dùm tui I_icon_minitime11/9/2010, 07:36

Thì ông viết luôn cái phương thức đọc ghi trong lớp đó luôn, như vậy khỏi lo gì! Hehe!
Về Đầu Trang Go down
Sakura

sửa lỗi dùm tui Stars7
Sakura

Thú CƯng : sửa lỗi dùm tui I-hate-Cats-icon
Nam Scorpio

Số bài viết : 1124
Điểm : 1688
Được cảm ơn : 35
Ngày sinh : 03/11/1990
Tham gia ngày : 16/03/2010
Tuổi : 33
Đến từ : Bình Dương
Ngề nghiệp : IT Student

sửa lỗi dùm tui Empty
Bài gửiTiêu đề: Re: sửa lỗi dùm tui   sửa lỗi dùm tui I_icon_minitime11/9/2010, 20:58

lovelonelyman đã viết:
Thì ông viết luôn cái phương thức đọc ghi trong lớp đó luôn, như vậy khỏi lo gì! Hehe!
Thấy chưa? Mem của nhóm tui Pro vậy đó, các huynh nên học hỏi nhiều nhá! Kakak!
Về Đầu Trang Go down
Sponsored content




sửa lỗi dùm tui Empty
Bài gửiTiêu đề: Re: sửa lỗi dùm tui   sửa lỗi dùm tui I_icon_minitime

Về Đầu Trang Go down
 

sửa lỗi dùm tui

Xem chủ đề cũ hơn Xem chủ đề mới hơn Về Đầu Trang 
Trang 1 trong tổng số 1 trang

Permissions in this forum:Bạn không có quyền trả lời bài viết
IT World! :: HỌC TẬP :: Học Kỳ IV :: Lập Trình Hướng Dối Tượng(OOP)-