Program Mimoze; Const N = 10; Var p, o, z, i: Integer; A: Array [0..N - 1] of Integer; Begin WriteLn('Введите через пробел ', N, ' чисел'); For i := 0 To N - 1 Do Read(A[i]); For i := 0 To N - 1 Do BeginIf A[i] < 0 Then Begin p := p + 1; z := z + 1; End Else If A[i] > 0 Then Begin o := o + 1; z := z + 1; End; End; WriteLn('Положительных: ', p); WriteLn('Отрицательных: ', o); WriteLn('Ненулевых: ', z); ReadLn; End.
Answers & Comments
Verified answer
Program Mimoze;Const N = 10;
Var p, o, z, i: Integer;
A: Array [0..N - 1] of Integer;
Begin
WriteLn('Введите через пробел ', N, ' чисел');
For i := 0 To N - 1 Do
Read(A[i]);
For i := 0 To N - 1 Do
BeginIf A[i] < 0 Then
Begin
p := p + 1;
z := z + 1;
End
Else If A[i] > 0 Then
Begin
o := o + 1;
z := z + 1;
End;
End;
WriteLn('Положительных: ', p);
WriteLn('Отрицательных: ', o);
WriteLn('Ненулевых: ', z);
ReadLn;
End.