kairat0101
02.07.2021 17:45

Выполнить указанные переводы чисел из одной системы в другую 1)4e(16)=x(10) 2)113(8)=x(10) 3)1011010(2)=x(10) 4)23.7(8)=x(10)

Нажмите на рекламу ниже и сразу увидите ответ
Популярные вопросы:
Ответ:
Strangeeo
13.05.2022 04:50

Объяснение:

Язык не был указан, так что пишу на С++:

1)

#include <iostream>

using namespace std;

int main()

{

   int buf, quantity = 0;

   cin >> buf;

   int sum = 0;

   while (buf != 0) {

       ++quantity;

       sum += buf;

       cin >> buf;

   }

   cout << "Sum: " << sum << "\nAverage: " << sum / quantity;

}

2)

#include <iostream>

using namespace std;

int main()

{

   int buf;

   cin >> buf;

   int max_num = buf;

   while (buf != 0) {

       if (max_num < buf) {

           max_num = buf;

       }

       cin >> buf;

   }

   cout << "Max: " << max_num;

}

0,0(0 оценок)
Ответ:
Sniper2016
16.02.2020 22:06

ответ:я не уверена в ответах(давно не решала такие задачи)

16

[29, 31]

[28, 30]

12

[21, 23]

[20, 22]

Объяснение:

def moves(heap):

   a,b=heap

   return[(a+1,b),(2*a,b),(a,b+1),(a,b*2)]

table={(k,s):0 for k in range(501)for s in range(501)}

for x in table:

   if any(sum(t)>=69 for t in moves(x)):

       table[x]=1

for x in table:

   if table[x]==0 and all(table[t]==1 for t in moves(x)):

       table[x]=2

for x in table:

   if table[x]==0 and any(table[t]==2 for t in moves(x)):

       table[x]=3

for x in table:

   if table[x]==0 and all(table[t]==3 or table[t]==1 for t in moves(x)):

       table[x]=4

print(min([s for s in range(1,118)if any(table[t]==1 for t in moves((5,s)))]))

print([s for s in range(1,118)if table[(5,s)]==3])

print([s for s in range(1,118)if table[(5,s)]==4])    

def moves(heap):

   a,b=heap

   return[(a+1,b),(2*a,b),(a,b+1),(a,b*2)]

table={(k,s):0 for k in range(501)for s in range(501)}

for x in table:

   if any(sum(t)>=53 for t in moves(x)):

       table[x]=1

for x in table:

   if table[x]==0 and all(table[t]==1 for t in moves(x)):

       table[x]=2

for x in table:

   if table[x]==0 and any(table[t]==2 for t in moves(x)):

       table[x]=3

for x in table:

   if table[x]==0 and all(table[t]==3 or table[t]==1 for t in moves(x)):

       table[x]=4

print(min([s for s in range(1,118)if any(table[t]==1 for t in moves((5,s)))]))

print([s for s in range(1,118)if table[(5,s)]==3])

print([s for s in range(1,118)if table[(5,s)]==4])      

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