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

Вычислите значение суммы 10(2) + 10(8) +10(16) в двоичной системе счисления

👇
Ответ:
dasha3007didek
dasha3007didek
20.03.2021
В начале считаем сумму, переведя числа в десятеричную:
2+8+16=26
26 в двоичной это 11010.
ответ: 11010.
4,8(26 оценок)
Открыть все ответы
Ответ:
elina162006
elina162006
20.03.2021

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 оценок)
Ответ:
milarudneva449
milarudneva449
20.03.2021
Язык C++.
1. #include <iostream>
using namespace std;
int main() {
    int i;
    cout <<"Введите число: " << endl;
    cin >> i;
    cout << "Вы ввели число: " << i << endl;
    }

2. #include <iostream>
using namespace std;
int main (){
    int i;
    cout << "Vvod" << endl;
    cin >> i;
    i %= 10;
    if(i %2 != 0)
    cout << "Нечетная" << endl;
    else
    cout << "Четная" << endl;
    }

3. #include<iostream>
using namespace std;
int main (){
for(int k = 0; k<4; k++){
cout << "random number = " << rand() << endl;
}
}

4. #include <iostream>
using namespace std;
int main(){
int i,a,b,c;
cin >> i;
c = i%10;
b =(i/10)%10;
a = i/100;
if(i*i==a*a*a+b*b*b+c*c*c)
cout<<"Является."<<endl;
else 
cout<<"Не является."<<endl;
}

5. #include <iostream>
#include <cmath>
const double pi = 3.1415926536;
using namespace std;
int main(){
    float x = 0;    cout << "Введите x: " << endl;
    cin >> x;
    cout << "y = " <<  sin((pi*(3.2+(sqrt(1+x))))/180)/abs(5*x) << endl;
    }

Добавляем "pi" и делим на 180, чтобы "sin" был в градусах.

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