翻译成Pascal语言:从11加到2009

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/08 20:25:49

翻译成Pascal语言:从11加到2009
翻译成Pascal语言:从11加到2009

翻译成Pascal语言:从11加到2009
program my;
var k:longint;
i:integer;
begin
for i:=11 to 2009 do
k:=k+i;
write(k);
readln;
end.

var
s,i:longint;
begin
for i:=11 to 2009 do begin
s:=s+i;
end;
writeln(s);
end.
蛮简单的,老板,给工资!!

var i,j:longint;
begin
for i:=1 to n do j:=j+i;
write(j);
end.

var
s,i:longint;
begin
s:=0;
for i:=11 to 2009 do
s:=s+i;
writeln(s);
end.

program pp;
var a,n:int64;
begin
assign(output,'pp.out');
rewrite(output);
n:=(2009-11) div 1+1;
a:=(11+2009)*n div 2;
writeln(output,a);
close(output);
end.

var a,b:integer;
begin
for b:= 11 to 2009 do
a:=a+b;
write(a);
end.