Объяснение:
program XandY;
const
rndlim=50;
var
x, y : integer;
begin
x:=random(rndlim);
y:=random(rndlim);
Writeln('x=',x,' y=', y);
Writeln('x+y = ',x+y);
Writeln('x-y = ',x-y);
Writeln('x*y = ',x*y);
Writeln('x^2 + y^2 = ',sqr(x)+sqr(y));
end.
Запуск:
Free Pascal Compiler version 2.6.2-8 [2014/01/22] for x86_64
Copyright (c) 1993-2012 by Florian Klaempfl and others
Target OS: Linux for x86-64
Compiling main.pas
Linking a.out
16 lines compiled, 0.2 sec
x=27 y=29
x+y = 56
x-y = -2
x*y = 783
x^2 + y^2 = 1570
Объяснение:
program XandY;
const
rndlim=50;
var
x, y : integer;
begin
x:=random(rndlim);
y:=random(rndlim);
Writeln('x=',x,' y=', y);
Writeln('x+y = ',x+y);
Writeln('x-y = ',x-y);
Writeln('x*y = ',x*y);
Writeln('x^2 + y^2 = ',sqr(x)+sqr(y));
end.
Запуск:
Free Pascal Compiler version 2.6.2-8 [2014/01/22] for x86_64
Copyright (c) 1993-2012 by Florian Klaempfl and others
Target OS: Linux for x86-64
Compiling main.pas
Linking a.out
16 lines compiled, 0.2 sec
x=27 y=29
x+y = 56
x-y = -2
x*y = 783
x^2 + y^2 = 1570