Program Task;
Const N = 10;
Var a: Array [1..N] of Integer;
i: Integer;
Begin
Randomize;
For i := 1 To N Do
a[i] := Random(25 + 20 + 1) - 20;
WriteLn('Результат №1: ');
Write(a[i], ' ');
WriteLn;
If a[i] > 0 Then
a[i] := 1
Else If
a[i] < 0 Then
a[i] := 0;
WriteLn('Результат №2:');
ReadLn;
End.
Подробнее - на -
Объяснение:
Program Task;
Const N = 10;
Var a: Array [1..N] of Integer;
i: Integer;
Begin
Randomize;
For i := 1 To N Do
a[i] := Random(25 + 20 + 1) - 20;
WriteLn('Результат №1: ');
For i := 1 To N Do
Write(a[i], ' ');
WriteLn;
For i := 1 To N Do
If a[i] > 0 Then
a[i] := 1
Else If
a[i] < 0 Then
a[i] := 0;
WriteLn('Результат №2:');
For i := 1 To N Do
Write(a[i], ' ');
ReadLn;
End.
Подробнее - на -
Объяснение: