//Bai Tap Lon Ve Lam Lich
#include<conio.h>
#include<stdlib.h>
#include <dos.h>
#include<iostream.h>
#include<string.h>
#include<ctype.h>
#include<stdio.h>
#include<string.h>
#define INTR 0x1C
#define ATTR 0x7900
#define XSTART 30
#ifdef __cplusplus
#define __CPPARGS ...
#else
#define __CPPARGS
#endif
#define x1 7
#define x2 32
#define x3 58
#define y1 8
#define y2 18
#define y3 28
#define y4 38
#define M 14
#define N 15+128
#define menux 10
#define menuy 15
int board[4][4];
int xspace, yspace;
void khoitao()
{
int i, j;
for (i=0; i<4; i++)
for (j=0; j<4; j++)
board[i][j] = i*4 + j + 1;
board[3][3] = 0;
}
void veboard()
{
int i, j;
textattr(2);
clrscr();
gotoxy(XSTART, 2);
cprintf("ÉÍÍÍÍËÍÍÍÍËÍÍÍÍËÍÍÍÍ»");
for (i=0; i<4; i++)
{
gotoxy(XSTART, 2*i+3);
cprintf("º º º º º");
gotoxy(XSTART, 2*i+4);
cprintf("ÌÍÍÍÍÎÍÍÍÍÎÍÍÍÍÎÍÍÍ͹");
}
gotoxy(XSTART, 10);
cprintf("ÈÍÍÍÍÊÍÍÍÍÊÍÍÍÍÊÍÍÍͼ");
for(i=0; i<4; i++)
for (j=0; j<4; j++)
{
gotoxy(XSTART+1 + j*5, i*2+3);
cprintf("%3d", board[i][j]);
}
gotoxy(XSTART+16, 9);
cprintf(" ");
gotoxy(XSTART, 14);
cprintf("Nhan S de bat dau.");
gotoxy(XSTART, 16);
cprintf("ESC de ket thuc.");
xspace = 3;
yspace = 3;
}
void dichtrai()
{
if (xspace < 3 )
{
board[yspace][xspace] = board[yspace][xspace+1];
board[yspace][xspace+1] = 0;
gotoxy(XSTART+1 + xspace*5, yspace*2+3);
cprintf("%3d", board[yspace][xspace]);
xspace++;
gotoxy(XSTART+1 + xspace*5, yspace*2+3);
cprintf(" ");
}
}
void dichphai()
{
if (xspace > 0 )
{
board[yspace][xspace] = board[yspace][xspace-1];
board[yspace][xspace-1] = 0;
gotoxy(XSTART+1 + xspace*5, yspace*2+3);
cprintf("%3d", board[yspace][xspace]);
xspace--;
gotoxy(XSTART+1 + xspace*5, yspace*2+3);
cprintf(" ");
}
}
void dichlen()
{
if (yspace < 3 )
{
board[yspace][xspace] = board[yspace+1][xspace];
board[yspace+1][xspace] = 0;
gotoxy(XSTART+1 + xspace*5, yspace*2+3);
cprintf("%3d", board[yspace][xspace]);
yspace++;
gotoxy(XSTART+1 + xspace*5, yspace*2+3);
cprintf(" ");
}
}
void dichxuong()
{
if (yspace > 0 )
{
board[yspace][xspace] = board[yspace-1][xspace];
board[yspace-1][xspace] = 0;
gotoxy(XSTART+1 + xspace*5, yspace*2+3);
cprintf("%3d", board[yspace][xspace]);
yspace--;
gotoxy(XSTART+1 + xspace*5, yspace*2+3);
cprintf(" ");
}
}
int test()
{
int i, j;
for (i=0; i<4; i++)
for (j=0; j<4; j++)
if (i!=yspace || j!=xspace)
if (board[i][j] != i*4 + j + 1)
return 0;
textattr(11);
gotoxy(XSTART, 18);
cprintf("XIN CHUC MUNG ! BAN DA CHIEN THANG");
getch();
return 1;
}
void run()
{
int done = 0, sobuoc = 0, i, n = 0;
char c;
randomize();
while (n < 100)
{
i = random(4);
switch(i)
{
case(0) : dichtrai();
break;
case(1) : dichphai();
break;
case(2) : dichlen();
break;
case(3) : dichxuong();
break;
}
n++;
}
gotoxy(XSTART, 14);
cprintf("%c %c %c %c de di chuyen.", 24, 25, 26, 27);
do {
c = getch();
if (c == 0)
c = getch();
switch(c)
{
case 27 : done = 1;
break;
case 75 : dichtrai();
break;
case 77 : dichphai();
break;
case 72 : dichlen();
break;
case 80 : dichxuong();
break;
}
sobuoc++;
gotoxy(XSTART, 12);
cprintf("So buoc : %d", sobuoc);
if (!done)
done = test();
} while (!done);
}
extern unsigned _heaplen = 1024;
extern unsigned _stklen = 512;
void interrupt ( *oldhandler)(__CPPARGS);
typedef unsigned int (far *s_arrayptr);
void interrupt handler(__CPPARGS)
{
s_arrayptr screen[80];
static int count,ticker;
int tam;
screen[0] = (s_arrayptr) MK_FP(0xB800,0);
count++;
if (ticker==0)
{
t.ti_sec++;
ticker=( ((count%5)==0)?19:18);
if (t.ti_sec==60)
{
t.ti_sec=0;
t.ti_min++;
}
if (t.ti_min==60)
{
t.ti_min=0;
t.ti_hour++;
}
if (t.ti_hour==24)
t.ti_hour=0;
screen[0][72] = t.ti_hour/10 + '0' + ATTR;
screen[0][73] = t.ti_hour%10 + '0' + ATTR;
screen[0][74] = ':' + ATTR;
screen[0][75] = t.ti_min/10 + '0' + ATTR;
screen[0][76] = t.ti_min%10 + '0' + ATTR;
screen[0][77] = ':' + ATTR;
screen[0][78] = t.ti_sec/10 + '0' + ATTR;
screen[0][79] = t.ti_sec%10 + '0' + ATTR;
}
ticker--;
oldhandler();
}
void main()
{int i,d,m,y,x=0,u=0,nhuan,q,s,v,z,nam;char j,c,ten[7];
int m1,m2,m3,m4,m5,m6,m7,m8,m9,m10,m11,m12,menu,gioitinh;
char menu1,menu2,menu3,menu4,menu5,thoat;
char can[][5]={"GIAP","AT","BINH","DINH","MAU","KI","CANH","TAN","NHAM","QUY"};
char chi[][5]={"TY","SUU","DAN","MAO","THIN","TI","NGO","MUI","THAN","DAU","TUAT","HOI"};
char n[7][4]={"CN","T2","T3","T4","T5","T6","T7"};
ra: { /*NHAN LON CUA CA CHUONG TRINH*/
textbackground(1);clrscr();
textcolor(11);
gotoxy(menux-8,menuy-12);cprintf("Sinh Vien: CHUNG MINH TU");
gotoxy(menux-8,menuy-10);cprintf("MaSoSV: 506101066");
gotoxy(menux-8,menuy-8);cprintf("SV Lop Cong Nghe Phan Mem & Quan Tri Mang");
gotoxy(menux-8,menuy-6);cprintf("Khoa CNTT-Truong DH PHUONG DONG");
gotoxy(menux-8,menuy-4);cprintf("Giang Vien Huong Dan: TRAN VAN LOC");
textcolor(10);
gotoxy(menux,menuy);cprintf("XIN CHAO! CAC BAN DANG SU DUNG PHAN MEM DAU TAY CUA TOI");
gotoxy(menux+8,menuy+2);cprintf(">> PHAN MEM UNG DUNG LICH DIEN TU <<");
textcolor(5); gotoxy(menux-2,menuy+4);cprintf("Phan Mem Rat De Su Dung Va Thiet Thuc.Have Fun!");
textcolor(2);gotoxy(menux-2,menuy+6);cprintf("MENU DE SU DUNG CHUONG TRINH:");
textcolor(14);
gotoxy(menux-2,menuy+10);cprintf("1..XEM LICH & NGAY THANG. ");
gotoxy(menux-2,menuy+12);cprintf("2..XEM THOI GIAN HIEN TAI CUA MAY TINH.");
gotoxy(menux-2,menuy+14);cprintf("3..XEM SO TU VI GIUM BAN. ");
gotoxy(menux-2,menuy+16);cprintf("4..MOT GAME NHO NHO DE GIAI TRI. ");
gotoxy(menux-2,menuy+18);cprintf("An 'Q' De Thoat Chuong Trinh!");
textcolor(4);gotoxy(menux-2,menuy+20);cprintf("Hay Nhap Vao So Cua Menu De Chon: ");thoat=getch();
if(thoat=='q') goto ra1;
if(thoat-'q') cin>>menu;
if((menu-1)*(menu-2)*(menu-3)*(menu-4))
{textcolor(10);gotoxy(menux,menuy+24);cprintf("Xin Loi Vi Menu Moi Chi Co 4 Chuc Nang !");
gotoxy(menux,menuy+26);cprintf("Hay Chon Lai Chuc Nang Muon Su Dung !");
getch();
goto ra; }
if(menu==1) //bat dau thuc hien menu 1
{ while(i!=27)
{ clrscr();
textcolor
(10);cprintf
("Nhap Vao Ngay Thang Nam\n\r");scanf("%d%d%d",&d
,&m
,&y
); if(((y%4==0)&&(y%100))||(y%400==0)) nhuan=1;else nhuan=0;
gotoxy(30,1);textcolor(7);
switch(m)
{ case 1:{ cprintf("Thang %d Nam %d Co 31 Ngay",m,y);u=d;}break;
case 2:{ cprintf("Thang %d Nam %d Co %d Ngay",m,y,28+nhuan);u=d+3;}break;
case 3:{ cprintf("Thang %d Nam %d Co 31 Ngay",m,y);u=d+3+nhuan;}break;
case 4:{ cprintf("Thang %d Nam %d Co 30 Ngay",m,y);u=d+6+nhuan;}break;
case 5:{ cprintf("Thang %d Nam %d Co 31 Ngay",m,y);u=d+1+nhuan;}break;
case 6:{ cprintf("Thang %d Nam %d Co 30 Ngay",m,y);u=d+4+nhuan;}break;
case 7:{ cprintf("Thang %d Nam %d Co 31 Ngay",m,y);u=d+6+nhuan;}break;
case 8:{ cprintf("Thang %d Nam %d Co 31 Ngay",m,y);u=d+2+nhuan;}break;
case 9:{ cprintf("Thang %d Nam %d Co 30 Ngay",m,y);u=d+5+nhuan;}break;
case 10:{ cprintf("Thang %d Nam %d Co 31 Ngay",m,y);u=d+nhuan;}break;
case 11:{ cprintf("Thang %d Nam %d Co 30 Ngay",m,y);u=d+3+nhuan;}break;
case 12:{ cprintf("Thang %d Nam %d Co 31 Ngay",m,y);u=d+5+nhuan;}break;
}
m1=31;m2=28+nhuan;m3=31;m4=30;m5=31;m6=30;m7=31;m8=31;m9=30;m10=31;m11=30;m12=31;
x=y-1+(y-1)/4-(y-1)/100+(y-1)/400;
textcolor(13);gotoxy(30,3);cprintf("Ngay %d Thang %d Nam %d La Ngay ",d,m,y);
switch((u+x-1)%7)
{ case 0:{cprintf("THU HAI");}break;
case 1:{cprintf("THU BA");}break;
case 2:{cprintf("THU TU");}break;
case 3:{cprintf("THU NAM");}break;
case 4:{cprintf("THU SAU");}break;
case 5:{cprintf("THU BAY");}break;
case 6:{cprintf("CHU NHAT");}break;
}
switch(x%7)
{ case 0:s=2;break;
case 1:s=3;break;
case 2:s=4;break;
case 3:s=5;break;
case 4:s=6;break;
case 5:s=7;break;
case 6:s=1;break;
}
textcolor(6);gotoxy(x2-10,y1-3);cprintf("Ban Co Muon Xem Lich Nam %d Khong(y/n)?",y);
j=getch();
if(j=='y'){
gotoxy(x2-10,y1-3); clreol();
textcolor(3);gotoxy(x2-10,y1-3);cprintf("BAN DANG XEM LICH CUA NAM %s %s - %d",can[(nam+6)%10],chi[(nam+8)%12],y);
//In To Lich Thang Mot
textcolor(11);gotoxy(x1,y1);cprintf("THANG MOT");
gotoxy(x1,y1+2);
for(i=0;i<7;i++)
{ if(i==0){textcolor(4);cprintf("%-2s " ,n[i]);}
if(i==6){textcolor(2);cprintf("%-2s " ,n[i]);}
if(i*(i-6)){textcolor(M);cprintf("%-2s ",n[i]);} }
gotoxy(x1,y1+4);
for(i=1,v=1;i<=m1;i++,s++)
{
if(s==1) {textcolor(4);cprintf("%2d ",i);}
if((s-7)*(s-1)){textcolor(M);cprintf("%2d ",i);}
if(s==7) {textcolor(2);cprintf("%2d ",i);}
if(s
==7) {printf("\n");gotoxy
(x1
,y1
+4+v
);s
=0;v
++;} if((i==d)&&(m==1)&&(s-7)){textcolor(N);cprintf("\b\b\b%2d ",i);}
}
//In To Lich Thang Hai
textcolor(11);gotoxy(x2,y1);cprintf("THANG HAI");
gotoxy(x2,y1+2);
for(i=0;i<7;i++)
{ if(i==0){textcolor(4);cprintf("%-2s " ,n[i]);}
if(i==6){textcolor(2);cprintf("%-2s " ,n[i]);}
if(i*(i-6)) {textcolor(M);cprintf("%-2s ",n[i]);} }
gotoxy(x2,y1+4);
for(i=1,v=1;i<=m2;i++,s++)
{ if(s==1) {textcolor(4);cprintf("%2d ",i);}
if((s-7)*(s-1)) {textcolor(M);cprintf("%2d ",i);}
if(s==7) {textcolor(2);cprintf("%2d ",i);}
if(s
==7) {printf("\n");gotoxy
(x2
,y1
+4+v
);s
=0;v
++;} if((i==d)&&(m==2)&&(s-7)){textcolor(N);cprintf("\b\b\b%2d ",i);}
}
//In To Lich Thang Ba
textcolor(11);gotoxy(x3,y1);cprintf("THANG BA");
gotoxy(x3,y1+2);
for(i=0;i<7;i++)
{ if(i==0){textcolor(4);cprintf("%-2s " ,n[i]);}
if(i==6){textcolor(2);cprintf("%-2s " ,n[i]);}
if(i*(i-6)) {textcolor(M);cprintf("%-2s ",n[i]); }}
gotoxy(x3,y1+4);
for(i=1,v=1;i<=m3;i++,s++)
{ if(s==1) {textcolor(4);cprintf("%2d ",i);}
if((s-7)*(s-1)) {textcolor(M);cprintf("%2d ",i);}
if(s==7) {textcolor(2);cprintf("%2d ",i);}
if(s
==7) {printf("\n");gotoxy
(x3
,y1
+4+v
);s
=0;v
++;} if((i==d)&&(m==3)&&(s-7)){textcolor(N);cprintf("\b\b\b%2d ",i);}
}
//In To Lich Thang Tu
textcolor(11);gotoxy(x1,y2);cprintf("THANG TU");
gotoxy(x1,y2+2);
for(i=0;i<7;i++)
{ if(i==0){textcolor(4);cprintf("%-2s " ,n[i]);}
if(i==6){textcolor(2);cprintf("%-2s " ,n[i]);}
if(i*(i-6)) {textcolor(M);cprintf("%-2s ",n[i]); }}
gotoxy(x1,y2+4);
for(i=1,v=1;i<=m4;i++,s++)
{ if(s==1) {textcolor(4);cprintf("%2d ",i);}
if((s-7)*(s-1)) {textcolor(M);cprintf("%2d ",i);}
if(s==7) {textcolor(2);cprintf("%2d ",i);}
if(s
==7) {printf("\n");gotoxy
(x1
,y2
+4+v
);s
=0;v
++;} if((i==d)&&(m==4)&&(s-7)){textcolor(N);cprintf("\b\b\b%2d ",i);}
}
//In To Lich Thang Nam
textcolor(11);gotoxy(x2,y2);cprintf("THANG NAM");
gotoxy(x2,y2+2);
for(i=0;i<7;i++)
{ if(i==0){textcolor(4);cprintf("%-2s " ,n[i]);}
if(i==6){textcolor(2);cprintf("%-2s " ,n[i]);}
if(i*(i-6)) {textcolor(M);cprintf("%-2s ",n[i]); }}
gotoxy(x2,y2+4);
for(i=1,v=1;i<=m5;i++,s++)
{ if(s==1) {textcolor(4);cprintf("%2d ",i);}
if((s-7)*(s-1)) {textcolor(M);cprintf("%2d ",i);}
if(s==7) {textcolor(2);cprintf("%2d ",i);}
if(s
==7) {printf("\n");gotoxy
(x2
,y2
+4+v
);s
=0;v
++;} if((i==d)&&(m==5)&&(s-7)){textcolor(N);cprintf("\b\b\b%2d ",i);}
}
//In To Lich Thang Sau
textcolor(11);gotoxy(x3,y2);cprintf("THANG SAU");
gotoxy(x3,y2+2);
for(i=0;i<7;i++)
{ if(i==0){textcolor(4);cprintf("%-2s " ,n[i]);}
if(i==6){textcolor(2);cprintf("%-2s " ,n[i]);}
if(i*(i-6)) {textcolor(M);cprintf("%-2s ",n[i]); }}
gotoxy(x3,y2+4);
for(i=1,v=1;i<=m6;i++,s++)
{ if(s==1) {textcolor(4);cprintf("%2d ",i);}
if((s-7)*(s-1)) {textcolor(M);cprintf("%2d ",i);}
if(s==7) {textcolor(2);cprintf("%2d ",i);}
if(s
==7) {printf("\n");gotoxy
(x3
,y2
+4+v
);s
=0;v
++;} if((i==d)&&(m==6)&&(s-7)){textcolor(N);cprintf("\b\b\b%2d ",i);}
}
//In To Lich Thang Bay
textcolor(11);gotoxy(x1,y3);cprintf("THANG TAM");
gotoxy(x1,y3+2);
for(i=0;i<7;i++)
{ if(i==0){textcolor(4);cprintf("%-2s " ,n[i]);}
if(i==6){textcolor(2);cprintf("%-2s " ,n[i]);}
if(i*(i-6)) {textcolor(M);cprintf("%-2s ",n[i]); }}
gotoxy(x1,y3+4);
for(i=1,v=1;i<=m7;i++,s++)
{ if(s==1) {textcolor(4);cprintf("%2d ",i);}
if((s-7)*(s-1)) {textcolor(M);cprintf("%2d ",i);}
if(s==7) {textcolor(2);cprintf("%2d ",i);}
if(s
==7) {printf("\n");gotoxy
(x1
,y3
+4+v
);s
=0;v
++;} if((i==d)&&(m==7)&&(s-7)){textcolor(N);cprintf("\b\b\b%2d ",i);}
}
//In To Lich Thang Tam
textcolor(11);gotoxy(x2,y3);cprintf("THANG TAM");
gotoxy(x2,y3+2);
for(i=0;i<7;i++)
{ if(i==0){textcolor(4);cprintf("%-2s " ,n[i]);}
if(i==6){textcolor(2);cprintf("%-2s " ,n[i]);}
if(i*(i-6)) {textcolor(M);cprintf("%-2s ",n[i]); }}
gotoxy(x2,y3+4);
for(i=1,v=1;i<=m8;i++,s++)
{ if(s==1) {textcolor(4);cprintf("%2d ",i);}
if((s-7)*(s-1)){textcolor(M);cprintf("%2d ",i);}
if(s==7) {textcolor(2);cprintf("%2d ",i);}
if(s
==7) {printf("\n");gotoxy
(x2
,y3
+4+v
);s
=0;v
++;} if((i==d)&&(m==8)&&(s-7)){textcolor(N);cprintf("\b\b\b%2d ",i);}
}
//In To Lich Thang Chin
textcolor(11);gotoxy(x3,y3);cprintf("THANG CHIN");
gotoxy(x3,y3+2);
for(i=0;i<7;i++)
{ if(i==0){textcolor(4);cprintf("%-2s " ,n[i]);}
if(i==6){textcolor(2);cprintf("%-2s " ,n[i]);}
if(i*(i-6)) {textcolor(M);cprintf("%-2s ",n[i]); }}
gotoxy(x3,y3+4);
for(i=1,v=1;i<=m9;i++,s++)
{ if(s==1) {textcolor(4);cprintf("%2d ",i);}
if((s-7)*(s-1)) {textcolor(M);cprintf("%2d ",i);}
if(s==7) {textcolor(2);cprintf("%2d ",i);}
if(s
==7) {printf("\n");gotoxy
(x3
,y3
+4+v
);s
=0;v
++;} if((i==d)&&(m==9)&&(s-7)){textcolor(N);cprintf("\b\b\b%2d ",i);}
}
//In To Lich Thang Muoi
textcolor(11);gotoxy(x1,y4);cprintf("THANG MUOI");
gotoxy(x1,y4+2);
for(i=0;i<7;i++)
{ if(i==0){textcolor(4);cprintf("%-2s " ,n[i]);}
if(i==6){textcolor(2);cprintf("%-2s " ,n[i]);}
if(i*(i-6)) {textcolor(M);cprintf("%-2s ",n[i]); }}
gotoxy(x1,y4+4);
for(i=1,v=1;i<=m10;i++,s++)
{ if(s==1) {textcolor(4);cprintf("%2d ",i);}
if((s-7)*(s-1)) {textcolor(M);cprintf("%2d ",i);}
if(s==7) {textcolor(2);cprintf("%2d ",i);}
if(s
==7) {printf("\n");gotoxy
(x1
,y4
+4+v
);s
=0;v
++;} if((i==d)&&(m==10)&&(s-7)){textcolor(N);cprintf("\b\b\b%2d ",i);}
}
//In To Lich Thang Muoi Mot
textcolor(11);gotoxy(x2,y4);cprintf("THANG MUOI MOT");
gotoxy(x2,y4+2);
for(i=0;i<7;i++)
{ if(i==0){textcolor(4);cprintf("%-2s " ,n[i]);}
if(i==6){textcolor(2);cprintf("%-2s " ,n[i]);}
if(i*(i-6)) {textcolor(M);cprintf("%-2s ",n[i]); }}
gotoxy(x2,y4+4);
for(i=1,v=1;i<=m11;i++,s++)
{ if(s==1) {textcolor(4);cprintf("%2d ",i);}
if((s-7)*(s-1)) {textcolor(M);cprintf("%2d ",i);}
if(s==7) {textcolor(2);cprintf("%2d ",i);}
if(s
==7) {printf("\n");gotoxy
(x2
,y4
+4+v
);s
=0;v
++;} if((i==d)&&(m==11)&&(s-7)){textcolor(N);cprintf("\b\b\b%2d ",i);}
}
//In To Lich Thang Muoi Hai
textcolor(11);gotoxy(x3,y4);cprintf("THANG MUOI HAI");
gotoxy(x3,y4+2);
for(i=0;i<7;i++)
{ if(i==0){textcolor(4);cprintf("%-2s " ,n[i]);}
if(i==6){textcolor(2);cprintf("%-2s " ,n[i]);}
if(i*(i-6)) {textcolor(M);cprintf("%-2s ",n[i]); }}
gotoxy(x3,y4+4);
for(i=1,v=1,z=1;i<=m12;i++,s++)
{ if(s==1) {textcolor(4);cprintf("%2d ",i);}
if((s-7)*(s-1)) {textcolor(M);cprintf("%2d ",i);}
if(s==7) {textcolor(2);cprintf("%2d ",i);}
if(s
==7) {printf("\n");gotoxy
(x3
,y4
+4+v
);s
=0;v
++;z
++;} if((i==d)&&(m==12)&&(s-7)){textcolor(N);cprintf("\b\b\b%2d ",i);}
}
printf("\n\n");printf("De Thoat Khoi Menu Hay An 'ESC'...."); printf("\nDe Tiep Tuc Xem Hay An 'ENTER'....");getch
(); }//ket thuc if(j=='y') else goto ra;
menu1=getch();i=toascii(menu1);
}
goto ra; }//ket thuc menu 1
if(menu==2) //bat dau thuc hien menu 2
{ do
{clrscr();
gettime(&t);
oldhandler = getvect(INTR);
setvect(INTR, handler);
menu=getch();i=toascii(menu);goto ra;
setvect(INTR,oldhandler);
keep(0, (_SS + (_SP/16) - _psp));
}
while(i!=27);
} //ket thuc menu 2
if(menu==3)
{textcolor(10);gotoxy(menux,menuy+24);cprintf("Menu Dang Trong Thoi Gian Hoan Thien.");
gotoxy(menux,menuy+26);cprintf("Vui Long Chon Lai Chuc Nang Muon Su Dung !");
getch();
goto ra; }
if(menu==4) //bat dau thuc hien menu 4
{clrscr();
void khoitao();
void veboard();
while(i==27)
if (c == 'S') run();
i=toascii(getch());}
goto ra;
} //ket thuc menu 4 >> if(menu==4)
} //ket thuc nhan 'ra:'
/*Doan Cuoi Chuong trinh Khi thoat ra*/
ra1: { textcolor(10);gotoxy(menux,menuy+24);cprintf("Ban Co That Su Muon Thoat Chuong Trinh Khong(y/n)? " );thoat=getch();
if(thoat=='y') {gotoxy(menux,menuy+24);clreol();
textcolor(3);gotoxy(menux,menuy+25);cprintf("Cam On Ban Da Su Dung Chuong Trinh Cua Toi !");
gotoxy(menux,menuy+27);cprintf("Chuc Ban Mot Ngay Tot Lanh.... "); }
if(thoat!='y') goto ra;
getch(); }//ket thuc nhan 'ra1:'
}//ket thuc Ham main chinh