9яна2005
08.01.2022 06:28

Курал саймандардын атауын жазыныз

Нажмите на рекламу ниже и сразу увидите ответ
Популярные вопросы:
Ответ:
MaryWintlstone
26.09.2022 05:57

1)

import random

number_list = []

for n in range(10):

   number_list.append(random.randint(-10, 10))

print(number_list)

number_list = [number * -1 for number in number_list]

print(number_list)

2)

import random

number_list = []

for n in range(10):

   number_list.append(random.randint(-10, 10))

amount = 0

for number in number_list:

   amount += number

print(amount)

3)

import random

number_list = []

for i in range(10):

   number_list.append(random.randint(-10, 10))

number_list = [number ** 2 for number in number_list]

amount = 0

for n in number_list:

   amount += n

print(amount)

4)

import random

number_list = []

for n in range(10):

   number_list.append(random.randint(-10, 10))

negative_numbers = []

positive_numbers = []

for number in number_list:

   if number < 0:

       negative_numbers.append(number)

   elif number > 0:

       positive_numbers.append(number)

amount_positive = 0

amount_negative = 0

for n in negative_numbers:

   amount_negative += n

print('сумма отрицательных чисел: ' + str(amount_negative))

for p in positive_numbers:

   amount_positive += p

print('сумма положительных: ' + str(amount_positive))

0,0(0 оценок)
Ответ:
driftstiwrx
20.03.2021 12:42

Задание №1:
int(-5,89)= -5
int(0,53)=0
round(-5,8)=-6
round(5,2)=5
frac(-17,4)=0,4
frac(0,32)=0,32
trunc(-17,4)=-17
trunc(15,2)=15
45 div 4=11
15 mod 8=7
(489 div 10) mod 10=8

Задача №2:

а=1, в=2;     a=2

а=3, в=3;    a=0

а=4, в=2;    a=2

а=-3, в=5    a=-15

Задача №3:

var m,s:integer;
begin
readln(m);
readln(s);
if s>m then writeln('Саша старше Маши')
        else if m>s then writeln('Маша старше Саши ')
              else writeln('Саша и Маша ровесники');
end.

Задача №4:

var a:real;
begin
write('Введите число: ');
readln(a);
if a>0 then a:=a/7
        else a:=a*a;
writeln(a);
end.

Задача №5:

var a,b:real;
begin
write('Введите первое число: ');
readln(a);
write('Введите второе число: ');
readln(b);
if a>b then writeln('Наибольшее число: ',a)
        else writeln('Наибольшее число: ',b);
end.

Задача №6:

var a,b,c,p:real;
begin
write('Введите первое число: ');
readln(a);
write('Введите второе число: ');
readln(b);
write('Введите третье число: ');
readln(c);
if a>b then if a>c then p:=a
                    else p:=c
       else if b>c then p:=b
                    else p:=c;
writeln('Наибольшее число: ',p);
end.

Задача №7:

var a,b,c,d,p:real;
begin
write('Введите первое число: ');
readln(a);
write('Введите второе число: ');
readln(b);
write('Введите третье число: ');
readln(c);
write('Введите четвертое число: ');
readln(d);
if a>b then if a>c then p:=a
                    else p:=c
       else if b>c then p:=b
                    else p:=c;
if p<d then p:=d;
writeln('Наибольшее число: ',p);
end.

Задача №8:

var a:real;
begin
a:=0;
while a<7.9 do
begin
  write('Введите скорость ракеты: ');
  readln(a);
  if (a>=7.9) and (a<11.2) then writeln('Ракета станет спутником Земли')
    else if (a>=11.2) and (a<16.6) then writeln('Ракета станет спутником Cолнца')
          else if a>=16.6 then writeln('Ракета покинет Cолнечную систему')
                          else writeln('Требуется повторный ввод скорости');
end;
end.

0,0(0 оценок)
Полный доступ
Позволит учиться лучше и быстрее. Неограниченный доступ к базе и ответам от экспертов и ai-bota Оформи подписку
logo
Начни делиться знаниями
Вход Регистрация
Что ты хочешь узнать?
Спроси ai-бота