===== PascalABC.NET =====
begin
var n := ReadInteger('n =');
var a := ArrRandom(n, -99, 99);
a.Println;
var x := a.Where(p -> p > 0).ToArray;
var y := a.Where(p -> p < 0).ToArray;
x.Println;
y.Println
end.
40= 101000 в двоичной
40= 50 в восьмеричной
40= 28 в шеснадцатеричной
<span><span>uses crt;
const n=7;
var sr:real;
i:integer;
a:array[1..n] of integer;
begin
clrscr;
sr:=0;
writeln('Vvedite temperaturu za kajdyi den ');
for i:=1 to n do begin
readln(a[i]);
sr:=sr+a[i];
end;
sr:=sr/7;
write('Srednya temperatura = ',sr:0:2);
readkey;
end.</span></span>
жёлтый лимон синяя луковица лимон и 2 луковицы синей
Python 3.6.1:
from random import random
N = 100
a = []
for i in range(N):
a.append(int(random()*2))
print(a[i],end=' ')
print()
for i in range(N):
if (a[i] == 0):
a[i] = 1
else:
a[i] = 0
print(a[i],end=' ')
from random import random
N = 20
a = []
for i in range(N):
a.append(int(random()*(2*N+1)-N))
print(a[i],end=' ')
Max = max(a)
Min = min(a)
print('\nMax =',Max)
print('Min =',Min)
print('Max - Min =',Max-Min)