1 câu trả lời
- Ví dụ 1:
Program VD_thutuc2;
Uses crt;
Var a, b, i: integer;
Procedure Ve_HCN(chdai, chrong: integer);
Var i,j: integer;
Begin {Ve canh tren cua hinh chu nhat}
For i:=1 to chdai do write(‘*’);
Writeln;
For j:=1 to chrong-2 do write(‘ ’);
Begin
Write(‘*’);
For i:=1 to chdai-2 do write(‘ ’);
Writeln(‘*’);
End;
For i:=1 to chdai do write(‘*’);
Writeln;
End;
BEGIN {Bat dau chuong trinh chinh}
Clrscr;
Ve_HCN(25,10);
Writeln;
Writeln;
Ve_HCN(5,10);
Readln;
Clrscr;
a:=4;
b:=2;
For i:=1 to 4 do
Begin
Ve_HCN(a,b);
Readln;
clrscr;
a:=a*2;
b:=b*2;
end;
Readln;
END.