close
終於寫出來了,好感動!
數字大三角語法:
procedure TForm1.Button4Click(Sender: TObject);
var
i,j,k,l:integer;
s:string;
begin
s:='';
for i:=1 to 7 do
begin
for k:=1 to (7-i)do
begin
s:=s+' ';
end;
for j:=i downto 1 do
begin
s:=s+inttostr(j);
end;
if (i1) then
for l:=2 to (i) do
begin
s:=s+inttostr(l);
end;
s:=s+#10#13;
end;
label5.Caption:=s;
end;
字母大三角語法:
procedure TForm1.Button5Click(Sender: TObject);
var
i,j,k,l:integer;
s:string;
begin
s:='';
for i:=65 to 71 do
begin
for k:=1 to (71-i)do
begin
s:=s+' ';
end;
for j:=i downto 65 do
begin
s:=s+char(j);
end;
if (i65) then
for l:=66 to (i) do
begin
s:=s+char(l);
end;
s:=s+#10#13;
end;
label7.Caption:=s;
end;
全站熱搜
留言列表