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

Информатика - Двоичная арифметика Вычислить:

1. 11101101 + 11011101

2. 11111001 + 10111101

3. 11101111 - 10101011

4. 11000011 - 10111111

5. 110101 * 10011

6. 101111 * 11101

7. 1011011111 : 10101

8. 10011000010 : 11101

👇
Открыть все ответы
Ответ:
vovazvyagin
vovazvyagin
17.02.2020

#include <iostream>

#include <vector>

using namespace std;

int f(vector<int> &u){

   int k = 1;

   bool has_negative = false;

   for(auto &i : u){

       if(i < 0){

           k *= i;

           has_negative = true;

       }

   }

   return k * has_negative;

}

signed main(){

   const int n = 5;

   vector<vector<int>> a(n, vector<int> (n));

   for(int i = 0; i < n; i++)

       for(int j = 0; j < n; j++)

           cin >> a[i][j];

   for(int i = 0; i < n; i++)

       cout << "Product of negatives in " << i + 1 << " line is " << f(a[i]) << "\n";

}

4,5(62 оценок)
Ответ:
нара123
нара123
17.02.2020

Вариант 1:

using namespace std;

#include <iostream>

#include <clocale>

#include <cstdlib>

#include <iomanip>

#include <string>

int main() {

setlocale(LC_ALL, "rus");

system("chcp 1251");

srand(time(0));

double x;

cout << "Введите значение x" << endl;

cin >> x;

if (x <= 0)

 cout << pow(x, 4) << endl;

if (x > 0)

 cout << log10(x) << endl;

system("pause");

return 0;

}

Вариант 2:

using namespace std;

#include <iostream>

#include <clocale>

#include <cstdlib>

#include <iomanip>

#include <string>

int main() {

setlocale(LC_ALL, "rus");

system("chcp 1251");

srand(time(0));

double x;

cout << "Введите значение x" << endl;

cin >> x;

if (x >= 2)

 cout << sqrt(x) << endl;

if (x < 2)

 cout << log(3 - x) << endl;

system("pause");

return 0;

}

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