baitap
/*xay dung lop hoc sinh gom ho ten va diem thi(che dau ho ten va diem)
sap xep danh sach theo diem giam dan*/
#include<stdio.h>
#include<conio.h>
#include<iostream.h>
#include <iomanip.h>
class hs
{
char hoten[30];
float diem;
public:
void nhap()
{
cout<<"
Nhap ten:";gets(hoten);
cout<<"
Nhap diem:";cin>>diem;
}
void inra()
{
cout.precision(2);
cout<<setw(30)<<hoten<<setw(5)<<diem<<"
";
}
float laydiem()
{
return diem;
}
};
void doicho(hs &x, hs &y)
{ hs tg;
tg = x;
x = y;
y = tg;
}
void main()
{ hs x[100]; int i, k, n;
cout<<"
Cho biet so hoc sinh"; cin>>n;
cout<<"
Nhap danh sach hoc sinh";
for(i=0; i<n;i++)
x[i].nhap();
for (i=0; i<n-1; i++)
{
int vt;
vt=i;
for (k = i+1; k<n; k++)
if (x[vt].laydiem()<x[k].laydiem())
vt=k;
if (vt!=i)
doicho(x[i], x[k]);
}
cout<<"
Danh sach sau khi sap:
";
for(i=0; i<n; i++)
x[i].inra();
getch();
}
bai phan so
#include<conio.h>
#include<iostream.h>
#include<math.h>
#include<iomanip.h>
#include<stdlib.h>
#include<stdio.h>
class PS
{ public:
int ts,ms;
friend ostream& operator <<(ostream& os,PS &p)
{ if(p.ms == 1) os<<"
"<<p.ts;
else
{ if(p.ts==0) os<<"
0";
else os<<p.ts<<"/"<<p.ms;
}
return os;
};
friend istream& operator >>(istream& is,PS &p)
{ cout<<"
Tu:";is>>p.ts;
cout<<"Mau:";is>>p.ms;
return is;
};
int ucln();
PS rutgon();
void hien_hon_so();
PS operator +(PS p2);
PS operator -(PS p2);
PS operator *(PS p2);
PS operator /(PS p2);
int operator ==(PS ps2);
int operator !=(PS ps2);
int operator >(PS ps2);
int operator >=(PS ps2);
int operator <(PS ps2);
int operator <=(PS ps2);
void ghitep();
void doctep();
};
int PS::ucln()
{ int x=abs(ts),y=abs(ms);
if(x==0) return 1;
else
{ while(x!=y)
if(x>y) x-=y;
else y-=x;
return(x);
}
};
PS PS::rutgon()
{
int x;
x=ucln();
ts=ts/x;
ms=ms/x;
if(ms<0){ ts=-ts;ms=-ms; }
return (*this);
};
void PS::hien_hon_so()
{ int nguyen;
PS a;
nguyen=ts/ms;
a.ts=ts-(nguyen*ms);
a.ms=ms;
if(nguyen!=0)
cout<<"("<<nguyen<<")";
cout<<a;
};
PS PS::operator +(PS p2)
{
PS q;
q.ts=ts*p2.ms+ms*p2.ts;
q.ms=ms*p2.ms;
return q.rutgon();
};
PS PS::operator -(PS p2)
{
PS q;
q.ts=ts*p2.ms-ms*p2.ts;
q.ms=ms*p2.ms;
return q.rutgon();
};
PS PS::operator *(PS p2)
{
PS q;
q.ts=ts*p2.ts;
q.ms=ms*p2.ms;
return q.rutgon();
};
PS PS::operator /(PS p2)
{
PS q;
q.ts=ts*p2.ms;
q.ms=ms*p2.ts;
return q.rutgon();
}
int PS::operator ==(PS ps2)
{
if( (ts*ps2.ms-ms*ps2.ts)==0 ) return 1; //TRUE dung
else return 0; //FALSE sai
};
int PS::operator !=(PS ps2)
{
if( (ts*ps2.ms-ms*ps2.ts)!=0 ) return 1; //TRUE dung
else return 0; //FALSE sai
};
int PS::operator >(PS ps2)
{
float kt=(float) (ts*ps2.ms-ms*ps2.ts)/(ms*ps2.ms);
if(kt>0) return 1; //TRUE dung
else return 0; //FALSE sai
};
int PS::operator >=(PS ps2)
{
float kt=(float) (ts*ps2.ms-ms*ps2.ts)/(ms*ps2.ms);
if(kt>=0) return 1; //TRUE dung
else return 0; //FALSE sai
};
int PS::operator <(PS ps2)
{
float kt=(float) (ts*ps2.ms-ms*ps2.ts)/(ms*ps2.ms);
if(kt<0) return 1; //TRUE dung
else return 0; //FALSE sai
};
int PS::operator <=(PS ps2)
{
float kt=(float) (ts*ps2.ms-ms*ps2.ts)/(ms*ps2.ms);
if(kt<=0) return 1; //TRUE dung
else return 0; //FALSE sai
};
void PS::ghitep()
{
FILE *f;
f=fopen("phanso.dat","a+b");
if(f==NULL)
{
cout<<"loi mo tep!";
getch();
}
else fwrite(this,sizeof(*this),1,f);
fclose(f);
};
void PS::doctep()
{
FILE *f=fopen("phanso.dat","r+b");
if(f==NULL)
{
cout<<"loi mo tep!";
getch();
}
else
while( fread(this,sizeof(*this),1,f)!=NULL )
cout<<*this;
fclose(f);
};
int menu()
{
int chon;
clrscr();
cout<<"
";
cout<<"
*-*-*-*-*-*- XAY DUNG LOP PHAN SO *-*-*-*-*-*-*-*-* ";
cout<<"
";
cout<<"
* CHUC NANG CHUONG TRINH *";
cout<<"
------------------------------";
cout<<"
| 1.SO SANH |";
cout<<"
| 2.DOI RA HON SO |";
cout<<"
| 3.RUT GON PHAN SO |";
cout<<"
| 4.CAC PHEP TINH TREN PHAN SO |";
cout<<"
| 0.THOAT |";
cout<<"
------------------------------";
cout<<"
MOI CHON CHUC NANG: ";
cin>>chon;
return chon;
};
void main()
{
int chon=1;
int u;
PS g,h;
while(chon)
{
chon=menu();
switch(chon)
{
case 1:
{
clrscr();
cout<<endl<<"Nhap phan so g:"<<endl;
cin>>g;
g.ghitep();g.rutgon();
cout<<"
nhap phan so h: ";
cin>>h;
h.ghitep();h.rutgon();
if(h<g)
cout<<h<<"<"<<g;
else if(h>g)
cout<<h<<">"<<g;
else
cout<<h<<"="<<g;
getch();break;
}
case 2:
{
clrscr();
cout<<"
phan so g"<<endl;
cin>>g;g.ghitep();
g.rutgon();g.hien_hon_so();
getch();
break;
}
case 3:
{ clrscr();
cout<<endl<<"nhap phan so: "<<endl;
cin>>g;
g.rutgon();
cout<<"
phan so sau khi rut gon:"<<g;getch(); break;
}
case 4:
{
clrscr();
cout<<endl<<"1.NHAN 2 PS";
cout<<endl<<"2.CHIA 2 PS";
cout<<endl<<"3.CONG 2 PS";
cout<<endl<<"4.TRU 2 PS";
cout<<endl<<"5.TINH BIEU THUC";
cout<<endl<<"VUI LONG CHON 1 CHUC NANG: ";
cin>>u;
switch(u)
{
case 1:
{
PS kq;
clrscr();
cout<<endl<<"Nhap phan so g:"<<endl;
cin>>g;
g.ghitep();g.rutgon();
cout<<"
nhap phan so h: ";
cin>>h;
h.ghitep();h.rutgon();
kq=g*h;
cout<<"tich 2 PS vua nhap la: "<<kq;getch(); break;
}
case 2:
{
PS kq2;
clrscr();
cout<<endl<<"Nhap phan so g:"<<endl;
cin>>g;
g.ghitep();g.rutgon();
cout<<"
nhap phan so h: ";
cin>>h;
h.ghitep();h.rutgon();
kq2=g/h;
cout<<"chia 2 PS vua nhap la: "<<kq2;getch(); break;
}
case 3:
{
PS KQ3;
clrscr();
cout<<endl<<"Nhap phan so g:"<<endl;
cin>>g;
g.ghitep();g.rutgon();
cout<<"
nhap phan so h: ";
cin>>h;
h.ghitep();h.rutgon();
KQ3=g+h;
cout<<"cong 2 PS vua nhap la: "<<KQ3;getch(); break;
}
case 4:
{
PS KQ4;
clrscr();
cout<<endl<<"Nhap phan so g:"<<endl;
cin>>g;
g.ghitep();g.rutgon();
cout<<"
nhap phan so h: ";
cin>>h;
h.ghitep();h.rutgon();
KQ4=g-h;
cout<<"hieu 2 da thuc vua nhap la: "<<KQ4;getch(); break;
}
case 5:
{
clrscr();
PS a,b,c,d,e,f,tong;
cin>>a;
cin>>b;
cin>>c;
cin>>d;
cin>>e;
cin>>f;
cout<<a<<endl;
cout<<b<<endl;
cout<<c<<endl;
cout<<d<<endl;
cout<<e<<endl;
cout<<f<<endl;
tong=a+b+((c-d)*e)/f;
cout<<" Ket qua la:"<<tong;
getch();break;
}
case 0:
{
break;
}
}
}
}
}
}
bai cong nhan
/* Xay dung lop Cong nhan voi cac thanh phan
-Thuoc tinh: Hoten, Hesoluong
-Phuong thuc: Nhap(), Hien, Tinhluong(long Luongcoban=450000)
+Lap trinh nhap vao danh sach 10 CN
+Hien danh sach ra man hinh (Hoten, Luong)
+Tinh tong so luong phai tra */
#include<stdio.h>
#include<conio.h>
#include<string.h>
#include<iostream.h>
class congnhan
{
private:
char hoten[20];
float hesoluong;
public:
void nhap();
void hien();
float tinhluong(long luongcoban=450000); //CHU Y: De phong tran so!
};
void congnhan :: nhap()
{
cout << "
Ho ten: ";
fflush(stdin);
gets(this->hoten);
cout << "
He so luong: ";
cin>> this->hesoluong;
}
void congnhan :: hien()
{
cout << this->hoten << "\t" << this->hesoluong << "\t" << tinhluong() << endl;
}
float congnhan :: tinhluong(long luongcoban)
{
return this->hesoluong*luongcoban;
}
void main()
{
clrscr();
int i;
long tong=0;
congnhan a[100];
for(i=0;i<10;i++)
{
a[i].nhap();
a[i].hien();
}
for(i=0;i<10;i++)
tong += a[i].tinhluong(); //Co the truyen doi so khac vao hoac neu khong truyen thi se lay tham so mac dinh cua phuong thuc
cout << "
Tong luong phai tra la: " << tong;
getch();
}
bài mang so nguyen
/*Nhap so nguyen duong cho den khi gap 0 thi dung
-Tim so lon nhat va nho nhat
-Xay dung ham tim Min, Max */
#include<iostream.h>
#include<conio.h>
typedef int mang[100];
int max(mang a, int i)
{
int j=0, max=-32767;
for(j=0; j<i; j++)
{
if(a[j]>max)
max=a[j];
}
return max;
}
int min(mang a, int i)
{
int j=0, min=32767;
for(j=0; j<i; j++)
{
if(a[j]<min)
min=a[j];
}
return min;
}
void main()
{
mang a;
clrscr();
int b=0,c,dem=0,i,j;
do
{
for(i=0; i<100; i++)
{ cout << "Nhap so bat ki:"; //Den so 0 se dung lai
cin >> a[i];
if(a[i]==0)
goto T;
if(dem==99)
goto T;
dem++;
}
}
while(1);
T: cout << "So lon lon nhat trong cac so vua nhap la:" << max(a,dem) << "
";
cout << "So nho nhat trong cac so vua nhap (Khong tinh 0) la:" << min(a,dem) << "
"; //Khong tinh phan tu 0
getch();
}
HINH CHU NHAT
#include<conio.h>
#include<stdio.h>
#include<iostream.h>
#include<graphics.h>
#include<string.h>
#include<math.h>
class hcn
{
int top,left,width,height,bgcolor;
public:
int gettop()
{
return this->top;
}
int getleft()
{
return this->left;
}
int getwidth()
{
return this->width;
}
int getheight()
{
return this->height;
}
int getbgcolor()
{
return this->bgcolor;
}
hcn()
{
this->top=100;
this->left=100;
this->width=100;
this->height=100;
}
hcn::hcn(int top,int left,int width,int height,int backgroundcolor)
{
this->top=top;
this->left=left;
this->width=width;
this->height=height;
this->bgcolor=backgroundcolor;
}
void ve();
};
void hcn::ve(){
int gdriver = DETECT,gmode,errorcode;
initgraph(&gdriver,&gmode ,"C:\\LAPTRINH\\TC\\BGI");
errorcode=graphresult();
if (errorcode==grOk)
{
//rectangle(left, top, left+width, top+height);
setfillstyle(SOLID_FILL, this->bgcolor); //Cach to mau nhu to dac, to cham, ...
bar(left, top, left+width, top+height);
}
else
{
cout<<"
Loi khoi tao che do Do hoa";
}
getch();
closegraph();
}
class MenuItem : public hcn
{
private:
char caption[100];
int color;
public:
MenuItem(int top,int left,int width,int height,int backgroundcolor, char caption[30], int color)
: hcn(top,left,width,height,backgroundcolor)
{
strcpy(this->caption,caption);
this->color = color;
}
void draw()
{
int gdriver = DETECT,gmode,errorcode;
initgraph(&gdriver,&gmode ,"C:\\LAPTRINH\\TC\\BGI");
errorcode=graphresult();
if (errorcode==grOk)
{
//rectangle(left, top, left+width, top+height);
setfillstyle(SOLID_FILL, hcn::getbgcolor()); //Cach to mau nhu to dac, to cham, ...
bar( hcn::getleft(), hcn::gettop(), (hcn::getleft()) + (hcn::getwidth()), hcn::gettop() + hcn::getheight());
setcolor(this->color);
//outtextxy( ( hcn::gettop()+hcn::getwidth() )/2,
// (hcn::getleft() + hcn::getheight())/2,
// this->caption);
int a,b;
a=(hcn::gettop()+hcn::getwidth()/2);
b=(hcn::getleft()+hcn::getheight()/2);
outtextxy(a,b,this->caption);
}
else
{
cout<<"
Loi khoi tao che do Do hoa";
}
getch();
closegraph();
}
};
void main(){
MenuItem a(100, 100, 100, 100, YELLOW, "a y e", GREEN);
//int gdriver = DETECT,gmode,errorcode;
//initgraph(&gdriver,&gmode ,"C:\\LAPTRINH\\TC\\BGI");
a.draw();
closegraph();
}
/* Da nang hoa toan tu +,- voi mang 1 chieu
Pham Phuong Tu */
#include<iostream.h>
#include<conio.h>
class MANG
{
int x[100],n;
public:
void nhap();
void hien();
MANG operator+(MANG c);
MANG operator-(MANG c);
};
void MANG::nhap()
{
cout<<"Nhap so luong phan tu cho mang:";
cin>>this->n;
cout << "Nhap cac phan tu:
";
for(int i=0;i<n;i++)
{
cout << "a[" << i <<"]=";
cin >> this->x[i];
}
}
void MANG::hien()
{
for(int i=0;i<n;i++)
cout << this->x[i] <<" ";
}
MANG MANG::operator+(MANG c)
{
int i;
MANG e;
e.n=this->n;
for(i=0;i<n;i++)
e.x[i]=this->x[i]+c.x[i];
return e;
}
MANG MANG::operator-(MANG c)
{
int i;
MANG e;
e.n=this->n;
for(i=0;i<n;i++)
e.x[i]=this->x[i]-c.x[i];
return e;
}
void main()
{
Z:clrscr();
char z;
MANG a,b;
a.nhap();
b.nhap();
MANG kq;
cout << "
Ket qua cong mang 1 cho mang 2 la:
";
kq=a+b;
kq.hien();
cout << "
Ket qua tru mang 1 cho mang 2 la:
";
kq=a-b;
kq.hien();
cout << "
Ban co muon thu lai voi 2 mang khac?
";
cout << " -Nhan 1 de thu lai
";
cout << " -Nhan phim bat ki de thoat
";
z=getch();
if(z=='1')
goto Z;
getch();
}
win
#include<iostream.h>
#include<conio.h>
#include<stdio.h>
#include<iomanip.h>
#include<string.h>
#include<dos.h>
void menu1(int n,int hd,int cd,int dai, char nd[][50],int mnc,int mcc,int mnr,int mcr,int *ch);
void hienkt(char *dkt,int h,int c,int dai,int mn,int mc);
void nhapmang(int a[],int &n);
void xuatmang(int a[],int n);
void timx(int a[],int n);
void max(int a[],int n);
void min(int a[],int n);
void nt(int a[],int n);
void tb(int a[],int n);
void tbd(int a[],int n);
void xeptd(int a[],int n);
void xepgd(int a[],int n);
void ten();
void main()
{
int n,a[20];
char nd[12][50];
int chon;
strcpy(nd[1],"1.Nhap mang can lam.");
strcpy(nd[2],"2.xuat mang vua nhap.");
strcpy(nd[3],"3.Tim vi tri x trong mang.");
strcpy(nd[4],"4.Vi tri nho nhat cua mang.");
strcpy(nd[5],"5.Vi tri lon nhat cua mang.");
strcpy(nd[6],"6.Trung binh max min cua mang.");
strcpy(nd[7],"7.Trung binh cac phan tu duong.");
strcpy(nd[8],"8.Tat ca nguyen to cua mang.");
strcpy(nd[9],"9.Sap xep tang dan cua mang.");
strcpy(nd[10],"10.Sap xep giam dan cua mang.");
strcpy(nd[11],"11.Gioi thieu ve nguoi lam.");
strcpy(nd[12],"12.Thoat khoi chuong trinh.");
textmode(C80);
clrscr();
chon=1;
while(chon!=12)
{
textbackground(BLUE);
clrscr();
menu1(12,8,25,31,nd,CYAN,YELLOW,BROWN,WHITE,&chon) ;
if(chon==1)
{
window(1,1,80,25);
textbackground(BLACK);
nhapmang(a,n);
getch();
}
if(chon==2)
{
window(1,1,80,25);
textbackground(BLACK);
xuatmang(a,n);
getch();
}
if(chon==3)
{
window(1,1,80,25);
textbackground(BLACK);
timx(a,n);
getch();
}
if(chon==4)
{
window(1,1,80,25);
textbackground(BLACK);
min(a,n);
getch();
}
if(chon==5)
{
window(1,1,80,25);
textbackground(BLACK);
max(a,n);
getch();
}
if(chon==6)
{
window(1,1,80,25);
textbackground(BLACK);
tb(a,n);
getch();
}
if(chon==7)
{
window(1,1,80,25);
textbackground(BLACK);
tbd(a,n);
getch();
}
if(chon==8)
{
window(1,1,80,25);
textbackground(BLACK);
clrscr();
nt(a,n);
getch();
}
if(chon==9)
{
window(1,1,80,25);
textbackground(BLACK);
xeptd(a,n);
getch();
}
if(chon==10)
{
window(1,1,80,25);
textbackground(BLACK);
xepgd(a,n);
getch();
}
if(chon==11)
{
window(1,1,80,25);
textbackground(BLACK);
ten();
getch();
}
}
}
void hienkt(char *dkt,int h,int c,int dai,int mn,int mc)
{
textbackground(mn);
textcolor(mc);
window(c,h,c+dai-1,h);
clrscr();
puts(dkt);
gotoxy(1,1);
}
void ten()
{
int i=0;
if(i!=1)
do
{
clrscr();
textcolor(i++);
gotoxy(60-i,i+2);
cprintf("XIN CHAO");
cout<<"
CAC BAN THAY SAO
";
gotoxy(i+1,45-i);
cprintf("soai lam duoc ko vay");
cout<<"
Ai ma tai the
";
gotoxy(i+1,i);
cprintf("Truong Cao Dang Ky Thuat Cao Thang
");
delay(200);
}
while(!kbhit());
}
void nhapmang(int a[],int &n)
{
int i;
cout<<"nhap vao so phan tu:";
cin>>n;
cout<<"nhap cac phan tu cua mang:";
for(i=0;i<n;i++)
cin>>a[i];
}
void xuatmang(int a[],int n)
{
int i;
cout<<" Mang vua nhap la:";
for(i=0;i<n;i++)
cout<<a[i]<<setw(4);
}
void timx(int a[],int n)
{
int x;
cout<<"
Nhap so x can tim:";
cin>>x;
for(int i=0;i<n;i++)
if(a[i]==x)break;
if(i<n)
cout<<x<<" O vi tri "<<i;
else
cout<<"-1
"<<x<<" Khong co trong mang";
}
int minl(int a[],int n)
{
int i,min=0;
for(i=0;i<n;i++)
if(a[i]<a[min])
min=i;
return min;
}
void min(int a[],int n)
{
cout<<endl;
cout<<"Vi tri so nho nhat trong mang: "<<minl(a,n);
}
int maxl(int a[],int n)
{
int j,max=0;
for(j=1;j<n;j++)
if(a[j]>a[max])
max=j;
return max;
}
void max(int a[],int n)
{
cout<<endl;
cout<<"Vi tri so lon nhat trong mang: "<<maxl(a,n);
}
void tb(int a[],int n)
{
float tb;
float s,e;
s=a[minl(a,n)];
e=a[maxl(a,n)];
tb=(s+e)/2;
cout<<"
Trung binh cong 2 so min va max: "<< tb;
}
int nguyento(int n)
{
int i,d=0;
for(i=1;i<=n;i++)
if(n%i==0)
d++;
return (d==2);
}
void nt(int a[],int n)
{
int i,d=0;
cout<<"
Cac so nguyen to trong mang: ";
for(i=0;i<n;i++){
if(a[i]==1)
cout<<a[i]<<setw(3);
if(nguyento(a[i]))
cout<<a[i]<<setw(3);}
}
void tbd(int a[],int n)
{
float d=0,s=0,tb;
int j;
for(j=0;j<n;j++)
if(a[j]>0){
s+=a[j];
d++;}
tb=s/d;
cout<<"
Trung binh cong cac phan tu duong: "<<tb;
}
void xeptd(int a[],int n)
{
int i,j,m,k;
for(i=0;i<n-1;i++)
{
for(j=i+1;j<n;j++)
{
if(a[i]>a[j])
{
m=a[i];a[i]=a[j];a[j]=m;
}
}
}
cout<<"
sap xep mang theo thu tu tang:";
for(k=0;k<n;k++)cout<<a[k]<<setw(4);
}
void xepgd(int a[],int n)
{
int i,j,m,k;
for(i=0;i<n-1;i++)
{
for(j=i+1;j<n;j++)
{
if(a[i]<a[j])
{
m=a[i];a[i]=a[j];a[j]=m;
}
}
}
cout<<"
sap xep mang theo thu tu giam:";
for(k=0;k<n;k++)cout<<a[k]<<setw(4);
}
void menu1(int n,int hd,int cd,int dai, char nd[][50],int mnc,int mcc,int mnr,int mcr,int *ch)
{
int i,chonm,mn,mc;
int ch1,ch2,chon;
chon=*ch;
if(n<=0||n>=20) return;
if(chon<0||chon>n)chon=1;
chonm=chon;
for(i=1;i<=n;++i)
hienkt(nd[i],hd+i-1,cd,dai,mnc,mcc);
hienkt(nd[chonm],hd+chonm-1,cd,dai,mnr,mcr);
ch1=0;
while(ch1!=13)
{
ch1=getch();
if(ch1==0)ch2=getch();
if(ch1==0)if(ch2==72)
{
chonm=chon-1;
if(chonm<=0)chonm=n;
}
else
if(ch2==80)
{
chonm=chon+1;
if(chonm>n)chonm=1;
}
if(chonm!=chon)
{
hienkt(nd[chon],hd+chon-1,cd,dai,mnc,mcc);
hienkt(nd[chonm],hd+chonm-1,cd,dai,mnr,mcr);
chon=chonm;
}
}
*ch=chon;
}
WINDOWN
#include<iostream.h>
#include<conio.h>
int main(void)
{
clrscr();
window(1,1,80,10);
//Window 1 co 10 hang, 80 cot
textcolor(BLACK);
textbackground(WHITE);
gotoxy(1,1); //Dong dau tien window thu 1
cout <<"***Window thu 1.....................................";
gotoxy(1,10); //Dong cuoi cung window thu 1
cout <<"---Het window thu 1.................................";
//clrscr(); //Xoa man hinh o window nay khong anh huong toi window kia
window(1,16,80, 50);//Do rong man hinh toi da trong che do Dos 80x50
//Window 2 co 35 hang, 80 cot
cout <<"***Window thu 2.....................................";
gotoxy(1, 35);
cout <<"---Het window thu 2.................................";
//clrscr(); //Xoa man hinh o window nay khong anh huong toi window kia
window(1,1,80,10); //Quay tro lai window 1
gotoxy(1,5); //Di den hang 5, cot 1 cua window 1
cout <<"Test window 1";
window(1,16,80, 50); //Quay tro lai window 2
gotoxy(1,5); //Di den hang 5, cot 1 cua window 2
cout <<"Test window 2";
getch();
return 0;
}
http://www.wattpad.com/415177-baitap
Bạn đang đọc truyện trên: AzTruyen.Top