1)
// PascalABC.NET 3.3
begin
var n:=ReadInteger('n =');
Range(1,n).Select(i->i*i).Println;
end.
Пример:
n = 5
1 4 9 16 25
2)
var n,i: integer;
begin
write('N = ');
readln(n);
i:=0;
while (i begin
i:=i+1;
write(i*i,' ');
end;
end.
3)
var n,i: integer;
begin
write('N = ');
readln(n);
i:=0;
repeat
i:=i+1;
write(i*i,' ');
until i=n;
end.
Пример:
N = 5
1 4 9 16 25