turbo Pascal 图形输出

来源:百度知道 编辑:UC知道 时间:2024/06/24 09:41:44
各位Pascal高手们:
这个图形怎样编写?
3
333
22222
222
1
还有:
* * *
*** *** ***
***** ***** *****
*********************
谢谢!!!
第二个图形错了,应该是
* * *
*** *** ***
***** ***** *****
*********************

第1个:
Program HW1_1;
Var
i,j,t:integer;
Begin
t:=4;
For i:=-2 to 2 do
Begin
If i mod 2=0 then t:=t-1;
Write(' ':abs(i)+1);
For j:=5 downto abs(i)*2+1 do
Write(t);
Writeln;
End;
Readln;
End.
第2个:Program HW3;
Var
i,j:integer;
Begin
For i:=1 to 4 do
Begin
Write(' ':5-i);
For j:=1 to i*2-1 do
Write('*');
If i<=3 then
Begin
Write(' ':4-i);
Write(' ':4-i);
End;
For j:=1 to i*2-1 do
Write('*');
If i<=3 then
Begin
Write(' ':4-i);
Write(' ':4-i);
End;
For j:=1 to i*2-1 do
Write('*');
Writeln;
End;
Readln;
End.