Tong howp bai tap pascal
Chau len 3
program am_thanh;
Uses crt;
Procedure creatsound(h,t:word);
begin
Sound(h);
Delay(t);
Nosound;
end;
Begin
creatSound(861,150);
creatSound(767,300);
creatSound(683,600);
creatSound(767,150);
creatSound(683,150);
creatSound(767,300);
creatSound(861,600);
Delay(60);
creatSound(767,300);
creatSound(767,300);
creatSound(861,300);
creatSound(683,150);
creatSound(861,150);
creatSound(767,300);
creatSound(861,300);
creatSound(683,600);
end.
co be mua dong
program CBMD;
uses crt;
var ch:char; k:byte;
const a=400; b=800; c=1600; d=200;
procedure tn(c:word;t:word);
begin sound(c);delay(trunc(t*(k/5)));nosound end;
begin clrscr;
textbackground(3);
textcolor(5);
gotoxy((80-length('*===Made in [You must be registered and logged in to see this link.] 2,2);writeln('*===Made in [You must be registered and logged in to see this link.]
textbackground(7);
textcolor(4);
gotoxy((80-length('Code by:Mr.NhatAnh'))div 2,3);writeln('Code by:Mr.NhatAnh');
textcolor(7);
textbackground(0);
gotoxy((80-length('--------------------------'))div 2,4);writeln('--------------------------');
gotoxy((80-length('Ban Co Muon Nghe Ban Nhac Co Be Mua Dong Khong (y/n)?:'))div 2,12);
textcolor(4);
write('Ban Co Muon Nghe Ban Nhac Co Be Mua Dong Khong (y/n)?:');
textcolor(7);
ch:=readkey;
if ch='n' then
begin clrscr;
gotoxy((80-length('Googbye!'))div 2,12);textcolor(4);write('Googbye!');delay(3000);
exit end else
begin
begin
writeln;
writeln;
writeln('* Nhap he so toc do k (1 ...10)');writeln('* Chu y nen de k=5 la chuan nhat! ');
write(' k:=');readln(k);writeln;
repeat
clrscr;
textcolor(5);
gotoxy((80-length('*===Made in [You must be registered and logged in to see this link.] 2,2);writeln('*===Made in [You must be registered and logged in to see this link.]
textbackground(7);
textcolor(4);
gotoxy((80-length('Code by:Mr.NhatAnh'))div 2,3);writeln('Code by:Mr.NhatAnh');
textcolor(7);
textbackground(0);
gotoxy((80-length('--------------------------'))div 2,4);writeln('--------------------------');
gotoxy((80-length('Co Be Mua Dong is playing!'))div 2,12);
tn(330,a);tn(440,a);tn(494,a);tn(523,b);tn(494,a); tn(523,a);tn(587,b);
tn(392,b);tn(659,a);tn(698,a);tn(659,a);tn(587,a); tn(523,a);tn(330,a);
tn(440,a);tn(494,a);tn(523,b);tn(494,a);tn(523,a); tn(587,b);tn(392,b);
tn(659,c);
tn(330,a);tn(440,a);tn(494,a);tn(523,b);tn(494,a); tn(523,a);tn(587,b);
tn(392,b);tn(784,b);tn(659,a);tn(698,a);tn(659,a); tn(587,a);tn(523,a);tn(330,a);
tn(440,a);tn(494,a);tn(523,b);tn(494,a);tn(440,a); tn(494,b);tn(392,b);tn(440,c);
tn(000,a);tn(440,a);tn(494,a);tn(523,b);tn(494,a); tn(440,a);tn(392,b);
tn(392,a);tn(440,a);tn(262,d);tn(262,d);tn(000,d); tn(392,a);tn(440,a);tn(262,a);tn(262,a);tn(000,d);
tn(440,d);tn(440,d);tn(494,d);tn(523,b);tn(494,a); tn(440,a);tn(392,b);
tn(392,a);tn(440,a);tn(440,a);tn(392,a);tn(349,a); tn(392,d);tn(392,d);
tn(440,a);tn(494,a);tn(523,b);tn(494,a);tn(440,a); tn(392,b);
tn(392,a);tn(440,a);tn(262,d);tn(262,d);tn(000,d); tn(392,a);tn(440,a);tn(262,a);tn(262,a);tn(000,d);
tn(440,d);tn(440,d);tn(494,d);tn(523,b);tn(494,a); tn(440,a);tn(392,b);tn(392,a);tn(440,b);tn(494,a); tn(523,a);
tn(494,c);tn(000,d);
tn(523,b);tn(659,a);tn(659,a);tn(494,a);tn(440,a); tn(392,b);tn(392,a);tn(440,b);tn(392,a);
tn(349,a);tn(330,a);tn(349,a);tn(392,b);tn(440,d); tn(494,d);tn(523,b);tn(523,a);tn(659,a);
tn(494,a);tn(440,a);tn(392,b);tn(392,d);tn(440,a); tn(440,d);tn(494,a);tn(523,a);tn(587,c);tn(000,d);
tn(659,b);tn(392,a);tn(659,a);tn(587,b);tn(784,a); tn(587,a);tn(523,a);tn(523,a);tn(330,a);tn(523,a);
tn(494,b);tn(440,a);tn(392,a);tn(440,b);tn(494,a); tn(523,a);tn(392,b);tn(523,a);tn(523,a);tn(659,a); tn(659,a);
tn(587,a);tn(523,a);tn(587,a);tn(440,a);tn(392,b); tn(000,d);
tn(659,b);tn(392,a);tn(659,a);tn(587,b);tn(784,a); tn(587,a);tn(523,a);tn(523,a);tn(330,a);tn(523,a);
tn(494,b);tn(440,a);tn(392,a);tn(440,b);tn(494,a); tn(523,a);tn(587,b);tn(523,a);tn(494,a);tn(523,a);
tn(494,a);tn(440,c);
gotoxy((80-length('Nghe nhac tiep khong (c/k)?: '))div 2,13);write('Nghe nhac tiep khong (c/k)?: ');
ch:=readkey;
until ch='k'
end;
begin clrscr;
gotoxy((80-length('Googbye!'))div 2,12);textcolor(4);write('Googbye!');delay(3000);
exit end ;
end;
end.
[You must be registered and logged in to see this link.]
Chau len 3
program am_thanh;
Uses crt;
Procedure creatsound(h,t:word);
begin
Sound(h);
Delay(t);
Nosound;
end;
Begin
creatSound(861,150);
creatSound(767,300);
creatSound(683,600);
creatSound(767,150);
creatSound(683,150);
creatSound(767,300);
creatSound(861,600);
Delay(60);
creatSound(767,300);
creatSound(767,300);
creatSound(861,300);
creatSound(683,150);
creatSound(861,150);
creatSound(767,300);
creatSound(861,300);
creatSound(683,600);
end.
co be mua dong
program CBMD;
uses crt;
var ch:char; k:byte;
const a=400; b=800; c=1600; d=200;
procedure tn(c:word;t:word);
begin sound(c);delay(trunc(t*(k/5)));nosound end;
begin clrscr;
textbackground(3);
textcolor(5);
gotoxy((80-length('*===Made in [You must be registered and logged in to see this link.] 2,2);writeln('*===Made in [You must be registered and logged in to see this link.]
textbackground(7);
textcolor(4);
gotoxy((80-length('Code by:Mr.NhatAnh'))div 2,3);writeln('Code by:Mr.NhatAnh');
textcolor(7);
textbackground(0);
gotoxy((80-length('--------------------------'))div 2,4);writeln('--------------------------');
gotoxy((80-length('Ban Co Muon Nghe Ban Nhac Co Be Mua Dong Khong (y/n)?:'))div 2,12);
textcolor(4);
write('Ban Co Muon Nghe Ban Nhac Co Be Mua Dong Khong (y/n)?:');
textcolor(7);
ch:=readkey;
if ch='n' then
begin clrscr;
gotoxy((80-length('Googbye!'))div 2,12);textcolor(4);write('Googbye!');delay(3000);
exit end else
begin
begin
writeln;
writeln;
writeln('* Nhap he so toc do k (1 ...10)');writeln('* Chu y nen de k=5 la chuan nhat! ');
write(' k:=');readln(k);writeln;
repeat
clrscr;
textcolor(5);
gotoxy((80-length('*===Made in [You must be registered and logged in to see this link.] 2,2);writeln('*===Made in [You must be registered and logged in to see this link.]
textbackground(7);
textcolor(4);
gotoxy((80-length('Code by:Mr.NhatAnh'))div 2,3);writeln('Code by:Mr.NhatAnh');
textcolor(7);
textbackground(0);
gotoxy((80-length('--------------------------'))div 2,4);writeln('--------------------------');
gotoxy((80-length('Co Be Mua Dong is playing!'))div 2,12);
tn(330,a);tn(440,a);tn(494,a);tn(523,b);tn(494,a); tn(523,a);tn(587,b);
tn(392,b);tn(659,a);tn(698,a);tn(659,a);tn(587,a); tn(523,a);tn(330,a);
tn(440,a);tn(494,a);tn(523,b);tn(494,a);tn(523,a); tn(587,b);tn(392,b);
tn(659,c);
tn(330,a);tn(440,a);tn(494,a);tn(523,b);tn(494,a); tn(523,a);tn(587,b);
tn(392,b);tn(784,b);tn(659,a);tn(698,a);tn(659,a); tn(587,a);tn(523,a);tn(330,a);
tn(440,a);tn(494,a);tn(523,b);tn(494,a);tn(440,a); tn(494,b);tn(392,b);tn(440,c);
tn(000,a);tn(440,a);tn(494,a);tn(523,b);tn(494,a); tn(440,a);tn(392,b);
tn(392,a);tn(440,a);tn(262,d);tn(262,d);tn(000,d); tn(392,a);tn(440,a);tn(262,a);tn(262,a);tn(000,d);
tn(440,d);tn(440,d);tn(494,d);tn(523,b);tn(494,a); tn(440,a);tn(392,b);
tn(392,a);tn(440,a);tn(440,a);tn(392,a);tn(349,a); tn(392,d);tn(392,d);
tn(440,a);tn(494,a);tn(523,b);tn(494,a);tn(440,a); tn(392,b);
tn(392,a);tn(440,a);tn(262,d);tn(262,d);tn(000,d); tn(392,a);tn(440,a);tn(262,a);tn(262,a);tn(000,d);
tn(440,d);tn(440,d);tn(494,d);tn(523,b);tn(494,a); tn(440,a);tn(392,b);tn(392,a);tn(440,b);tn(494,a); tn(523,a);
tn(494,c);tn(000,d);
tn(523,b);tn(659,a);tn(659,a);tn(494,a);tn(440,a); tn(392,b);tn(392,a);tn(440,b);tn(392,a);
tn(349,a);tn(330,a);tn(349,a);tn(392,b);tn(440,d); tn(494,d);tn(523,b);tn(523,a);tn(659,a);
tn(494,a);tn(440,a);tn(392,b);tn(392,d);tn(440,a); tn(440,d);tn(494,a);tn(523,a);tn(587,c);tn(000,d);
tn(659,b);tn(392,a);tn(659,a);tn(587,b);tn(784,a); tn(587,a);tn(523,a);tn(523,a);tn(330,a);tn(523,a);
tn(494,b);tn(440,a);tn(392,a);tn(440,b);tn(494,a); tn(523,a);tn(392,b);tn(523,a);tn(523,a);tn(659,a); tn(659,a);
tn(587,a);tn(523,a);tn(587,a);tn(440,a);tn(392,b); tn(000,d);
tn(659,b);tn(392,a);tn(659,a);tn(587,b);tn(784,a); tn(587,a);tn(523,a);tn(523,a);tn(330,a);tn(523,a);
tn(494,b);tn(440,a);tn(392,a);tn(440,b);tn(494,a); tn(523,a);tn(587,b);tn(523,a);tn(494,a);tn(523,a);
tn(494,a);tn(440,c);
gotoxy((80-length('Nghe nhac tiep khong (c/k)?: '))div 2,13);write('Nghe nhac tiep khong (c/k)?: ');
ch:=readkey;
until ch='k'
end;
begin clrscr;
gotoxy((80-length('Googbye!'))div 2,12);textcolor(4);write('Googbye!');delay(3000);
exit end ;
end;
end.
[You must be registered and logged in to see this link.]