М
Молодежь
К
Компьютеры-и-электроника
Д
Дом-и-сад
С
Стиль-и-уход-за-собой
П
Праздники-и-традиции
Т
Транспорт
П
Путешествия
С
Семейная-жизнь
Ф
Философия-и-религия
Б
Без категории
М
Мир-работы
Х
Хобби-и-рукоделие
И
Искусство-и-развлечения
В
Взаимоотношения
З
Здоровье
К
Кулинария-и-гостеприимство
Ф
Финансы-и-бизнес
П
Питомцы-и-животные
О
Образование
О
Образование-и-коммуникации
TrevorTime
TrevorTime
16.11.2020 19:57 •  Информатика

Для каждого из перечисленных ниже десятичных чисел построили двоичную запись. укажите все числа, двоичная запись которых содержит ровно 4 единицы. 15 18 21 23 27

👇
Ответ:
15_{10}=1111_2\\18_{10}=10010_2\\21_{10}=10101_2\\23_{10}=10111_2\\27_{10}=11011_2
27, 23, 15
4,5(82 оценок)
Открыть все ответы
Ответ:
aushatsy
aushatsy
16.11.2020
  present simple общие does he go to school every day? does she really like singing? is it cold today? do cats catch mice? has he got a real friend? альтернативные does she go to shool every day or once a month? do cats catch mice or dogs? is the earth round or square? is russia bigger or smaller than other countries? does he like skiing or skating? специальные what does he do at school every day? who likes dancing? when does winter come? where does she live? what does she always wait for? present progressive общие is it raining now? is the sun shining at the moment? is he writing his composition now? are they swimming in the pool at the moment? are you doing your homework? альтернативные are you doing your homework or watching tv now? is it raining or snowing now? are they flying to italy or to canada now? is he reading a book or a web-page? is she clever or not? специальные what is she looking forward for? where are they going to go next summer? when is he leaving for france? whom is she writing an e-mail? what are they doing now?
4,4(19 оценок)
Ответ:
elina162006
elina162006
16.11.2020

var

 s, s1, s2, s3, s4, tmp1, tmp2: string;

 i, a, b, c, d, e, f: integer;

begin

 Writeln('Введите строку: ');

 Readln(s);

 //

 for var k := 1 to length(s) do  

 begin

   if (s[k] = '(') then

   begin

     var j := k + 1;

     while (s[j].IsDigit) do

     begin

       tmp1 := tmp1 + s[j];

       j := j + 1;

     end;

     var ch := s[j];

     j := j + 1;

     while (s[j].IsDigit) do

     begin

       tmp2 := tmp2 + s[j];

       j := j + 1;

     end;

     case ch of

       '+': begin s := s.Remove(k - 1, j - k + 1); s := s.Insert(k - 1, inttostr(tmp1.ToInteger + tmp2.ToInteger)); end;

       '-': begin s := s.Remove(k - 1, j - k + 1); s := s.Insert(k - 1, inttostr(tmp1.ToInteger - tmp2.ToInteger)); end;

       '*': begin s := s.Remove(k - 1, j - k + 1); s := s.Insert(k - 1, inttostr(tmp1.ToInteger * tmp2.ToInteger)); end;

       '/': begin s := s.Remove(k - 1, j - k + 1); s := s.Insert(k - 1, inttostr(tmp1.ToInteger div tmp2.ToInteger)); end;

     end;

     break;

   end;

 end;

 //

 for i := 1 to length(s) do

 begin

   if (s[i] = '+') or (s[i] = '-') or (s[i] = '*') or (s[i] = '/') then

   begin

     s1 := copy(s, 1, i - 1);

     s2 := copy(s, i + 1, length(s));

     c := i;

   end;

 end;

 for i := 1 to length(s1) do

 begin

   if (s1[i] = '+') or (s1[i] = '-') or (s1[i] = '*') or (s1[i] = '/') then

   begin

     s3 := copy(s1, 1, i - 1);

     s4 := copy(s1, i + 1, length(s1));

     e := i;

   end;

 end;

 Val(s3, a, d);

 Val(s4, b, d);

 Val(s2, f, d);

 if (s[e] = '/') and (s[c] = '/') then Writeln((a div b) div f);

 if (s[e] = '/') and (s[c] = '*') then Writeln((a div b) * f);

 if (s[e] = '+') and (s[c] = '*') then Writeln(a + (b * f));

 if (s[e] = '*') and (s[c] = '*') then Writeln(a * b * f);

 if (s[e] = '+') and (s[c] = '/') then Writeln(a + (b div f));

 if (s[e] = '*') and (s[c] = '+') then Writeln((a * b) + f);

 if (s[e] = '/') and (s[c] = '+') then Writeln((a div b) + f);

 if (s[e] = '*') and (s[c] = '/') then Writeln((a * b) div f);

 if (s[e] = '+') and (s[c] = '+') then Writeln(a + b + f);

 if (s[e] = '-') and (s[c] = '-') then Writeln(a - b - f);

 if (s[e] = '+') and (s[c] = '-') then Writeln(a + b - f);

 if (s[e] = '-') and (s[c] = '+') then Writeln(a - b + f);

 if (s[e] = '*') and (s[c] = '-') then Writeln((a * b) - f);

 if (s[e] = '/') and (s[c] = '-') then Writeln((a div b) - f);

 if (s[e] = '-') and (s[c] = '*') then Writeln(a - (b * f));

 if (s[e] = '-') and (s[c] = '/') then Writeln(a - (b div f));

end.

4,6(73 оценок)
Это интересно:
Новые ответы от MOGZ: Информатика
logo
Вход Регистрация
Что ты хочешь узнать?
Спроси Mozg
Открыть лучший ответ