Информационный объем каждого из двух текстовых документов задан в байтах и битах, т.е. программа получает на вход 4 числа: байты и биты, объем первого документа, и байты и биты, объем второго документа. на сколько байтов и битов объем первого документа больше объема второго документа? выведите результат с поясняющими надписями в центр экрана.
from random import random
N = 10
a = []
for i in range(N):
b = int(random() * 50)
a.append(b)
print(a)
min = 101
for i in range(N-1):
s = a[i]+a[i+1]
if (s < min) and (s % 2 == 1):
min=s
print(min)
Пример:[41, 35, 16, 7, 29, 9, 16, 28, 10, 6]
23
2)
from random import random
N = 10
a = []
for i in range(N):
b = int(random() * 50)-25
a.append(b)
print(a)
k = 0
for i in range(N-1):
p = a[i]*a[i+1]
s = a[i]+a[i+1]
if (p % 2 != 0) and (s > 0):
k = k+1
print(k)
Пример:[11, 23, 12, -16, 21, 15, -11, -10, 10, 17]
3
Program asd;
uses crt;
var a,b,c,max:integer; r:real;
begin
Write('Введите число A: ');
Readln(a);
Write('Введите число B: ');
Readln(b);
Write('Введите число C: ');
Readln(c);
If a>=b then max:=a
else
max:=b;
If c>max then
max:=c;
r:=a+b+c;
If (A>B) and (B>C) and (C>0) then
Writeln('A= ',a*2,' B= ',b*2,' C= ',c*2);
If (A<0) and (B<0) and (C<0) and (A<>B) and (B<>C) and (C<>A) then
begin
A:=max;
B:=max;
C:=max;
Writeln('A= ',a,' B= ',b,' C= ',c);
end
else
Writeln('Symma: ',r);
end
Объяснение:
Program asd;
uses crt;
var a,b,c,max:integer; r:real;
begin
Write('Введите число A: ');
Readln(a);
Write('Введите число B: ');
Readln(b);
Write('Введите число C: ');
Readln(c);
If a>=b then max:=a
else
max:=b;
If c>max then
max:=c;
r:=a+b+c;
If (A>B) and (B>C) and (C>0) then
Writeln('A= ',a*2,' B= ',b*2,' C= ',c*2);
If (A<0) and (B<0) and (C<0) and (A<>B) and (B<>C) and (C<>A) then
begin
A:=max;
B:=max;
C:=max;
Writeln('A= ',a,' B= ',b,' C= ',c);
end
else
Writeln('Symma: ',r);
end