Const N = 20; Var A:array[1..N] of real; i:integer; R:real; Begin Randomize; R:=0; For i:= 1 to N do Begin A[i]:=random*(2*N+1)-N; R:=R-A[i]; Write(A[i]:0:1,' ') End; WriteLn; WriteLn('R = ',R); End.
Ввод с клавиатуры:
Const N = 20; Var A:array[1..N] of real; i:integer; R:real; Begin R:=0; For i:= 1 to N do Begin Read(A[i]); R:=R-A[i]; End; WriteLn('R = ',R); End.
Const N = 20;
Var
A:array[1..N] of real;
i:integer;
R:real;
Begin
Randomize;
R:=0;
For i:= 1 to N do
Begin
A[i]:=random*(2*N+1)-N;
R:=R-A[i];
Write(A[i]:0:1,' ')
End;
WriteLn;
WriteLn('R = ',R);
End.
Ввод с клавиатуры:
Const
N = 20;
Var
A:array[1..N] of real;
i:integer;
R:real;
Begin
R:=0;
For i:= 1 to N do
Begin
Read(A[i]);
R:=R-A[i];
End;
WriteLn('R = ',R);
End.