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

来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/16 21:44:25
翻译成Pascal语言:从11加到2009翻译成Pascal语言:从11加到2009翻译成Pascal语言:从11加到2009programmy;vark:longint;i:integer;begi

翻译成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.