

Đang ngồi nhớ ra tuần trước làm code, post lên anh em xem ủng hộ và cho ý kiến (mong có ý kiến tốt 
)
Code đây
Code đây
Mã:
program Oan_tu_ti;
uses crt;
var N:integer;
h1,h2:integer;
begin
clrscr;
textbackground(7);
textcolor(12);
writeln('Xin chao! Choi ngay thoi!!!');
writeln('Nhan 1 de choi');
readln(N);
if N=1 then
begin
clrscr;
randomize;
textcolor(1);
writeln('Ban chon gi?');
writeln('1: bua');
writeln('2: bao');
writeln('3: keo');
readln(h1);
h2:=random(2)+1;
clrscr;
textcolor(3);
writeln('Ban chon ',h1);
writeln('May chon ',h2);
writeln('');
textcolor(3);
if (h1=1) and (h2=1) or (h1=2) and (h2=2) or (h1=3) and (h2=3) then
writeln('Hoa!');
if (h1=2) and (h2=1) or (h1=3) and (h2=2) or (h1=1) and (h2=3) then
writeln('Ban thang!');
if (h1=1) and (h2=2) or (h1=2) and (h2=3) or (h1=3) and (h2=1) then
writeln('Ban thua!');
readln;
end;
clrscr;
textbackground(14);
textcolor(11);
writeln('Tac gia: Hoang Xuan Dung');
readln;
end.
Last edited: