一道简单PASCAL问题..

来源:百度知道 编辑:UC知道 时间:2024/05/14 10:07:13
1+(1+2)+(1+2+3)+....+(1+2+3+4+5+6+7+8+9+10)..

用For做哈~~~

谢谢~!~

var
i,t,s:integer;
begin
for i:=1 to 10 do
begin
t:=t+i;
s:=s+t;
end;
end.

program work(input,output);
var
i,j,s:integer;

begin
s:=0;
for i:=1 to 10 do
for j:=1 to i do
s;:=s+j;

writeln(s);
end.

program 名字
var a,b:integer;
const c=0
begin
for a:=1 to 10 do
begin
for b:=0 to a do
c:=c+b;
end;
end;
writeln(c);
end.