#include <iostream>
using namespace std;
int main()
{
int N;
int i1=0,i2=0;
cin>>N;
for(int i=0;i<N;i++)
{
int a = rand()%11-5;
if(a<0)
i1++;
if(a>0)
i2++;
}
cout<<">0 - "<<i2<<endl<<"<0 - "<<i1<<endl<<"!=0 - "<<i1+i2<<endl;
system("PAUSE");
}
P.S. Задачу можно решить не только через Turbo Pascal.
TurboPascal(может не очень верно)
var
a,n, i1, i2, i: integer;
begin
n := 42;
for i:=1 to n do begin
a:=random(11)-5;
if a > 0 then
i1 := i1 + 1;
if a < 0 then
i2 := i2 + 1;
end;
writeln("> 0-", i1);
writeln("< 0-", i2);
writeln("<>0-", i1+i2);
end.
AVG AntiVirus Free. Популярный бесплатный антивирус с простым интерфейсом. ...
Avira Free Security Suite. ...
Bitdefender Antivirus Free Edition. ...
Comodo Internet Security. ...
Avast Free Antivirus. ...
Kaspersky Free. ...
Panda Free Antivirus. ...
360 Total Security.