PROGRAM BAI7BAI7BAI7;BAI7;;; PROGRAM PROGRAM PROGRAM USES CRT;U...
Bài 7.
program Bai7
Bai7
Bai7;
Bai7
;
;
;
program
program
program
uses crt;
uses crt;
uses crt;
uses crt;
var b, c, n:byte;
var b, c, n:byte;
var b, c, n:byte;
var b, c, n:byte;
beg
beg
beg
begin
in
in
in
clrscr;
clrscr;
clrscr;
clrscr;
repeat
repeat
repeat
repeat
write('Nhap tuoi cha: ');readln(b);
write('Nhap tuoi cha: ');readln(b);
write('Nhap tuoi cha: ');readln(b);
write('Nhap tuoi cha: ');readln(b);
write('Nhap tuoi con: ');readln(c);
write('Nhap tuoi con: ');readln(c);
write('Nhap tuoi con: ');readln(c);
write('Nhap tuoi con: ');readln(c);
if (b
if (b
if (b
if (b-
-
-
-c<25) or (b<2*c) then
c<25) or (b<2*c) then
c<25) or (b<2*c) then
c<25) or (b<2*c) then
writeln('Du lieu khong hop le,nhap lai.');
writeln('Du lieu khong hop le,nhap lai.');
writeln('Du lieu khong hop le,nhap lai.');
writeln('Du lieu khong hop le,nhap lai.');
Great by: Nguyễn Trọng Hoàng Email: [email protected]
until (b
until (b-
-
-c>=25) and (b>=2*c);
-
c>=25) and (b>=2*c);
c>=25) and (b>=2*c);
c>=25) and (b>=2*c);
until (b
until (b
if b=2*c then
if b=2*c then
if b=2*c then
if b=2*c then
writeln('Hien nay tuoi cha gap hai lan tuoi con.')
lan tuoi con.')
lan tuoi con.')
lan tuoi con.')
writeln('Hien nay tuoi cha gap hai
writeln('Hien nay tuoi cha gap hai
writeln('Hien nay tuoi cha gap hai
else
else
else
else
if b>2*c then
if b>2*c then
if b>2*c then
if b>2*c then
writeln('Sau ',b
writeln('Sau ',b
writeln('Sau ',b
writeln('Sau ',b-
-
-
-2*c,' nam tuoi cha se gap doi tuoi
2*c,' nam tuoi cha se gap doi tuoi
2*c,' nam tuoi cha se gap doi tuoi
2*c,' nam tuoi cha se gap doi tuoi
con');
con');
con');
con');
readln
readln
readln
readln
end
end
end
end.
.
.
.
Ví Dụ
Ví Dụ
Ví Dụ
Ví Dụ