илюхаaaaa
24.02.2023 02:49

Складіть програму для розв'язування задач методом перебору(Інформатика 7 клас). Придбали олівці по 6 грн і зошити по 5 грн. Вартість покупки склала 68 грн. Скільки купили олівців і зошитів?

Нажмите на рекламу ниже и сразу увидите ответ
Популярные вопросы:
Ответ:
Vandannc
10.01.2020 19:04
Вот: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 const   n=5; var   a: array[1..n,1..n] of integer;   i,j,s: integer; begin   s: =0;   randomize;   for i: =1 to n do     begin       for j: =1 to n do         begin           a[i,j]: =random(10);           write(a[i,j]: 4);           if (i+j) mod 3=0 then             s: =s+a[i,j];         end;       writeln;     end;   writeln('s=',s); end.
0,0(0 оценок)
Ответ:
nika7912
09.08.2020 09:08

31

Объяснение:

/** libraries */

#include <iostream>

#include <cmath>

#include <vector>

#include <map>

#include <set>

#include <queue>

#include <stack>

#include <algorithm>

/** libraries */

using namespace std;

/** defines */

#define ll long long

#define ld long double

#define yes cout << "YES" << "\n"

#define no cout << "NO" << "\n"

/** defines */

ll to_10(ll num){

   ll i = 0,res = 0;

   while(num > 0){

       res += pow(2,i) * (num % 10);

       num /= 10;

       i++;

   }

   return res;

}

signed main() {

   ios_base::sync_with_stdio(false);

   cin.tie(nullptr);

   cout.tie(nullptr);

   for(ll x = -1000000; x <= 1000000; x++){

       if(x - to_10(11110) > 0&&to_10(11) * to_10(1001) - sqrt((to_10(101011) + to_10(111001))/(x-to_10(11110))) == to_10(10001)){

           cout << x;

           return 0;

       }

   }

}

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