leylakhalimova
02.05.2023 17:13

Напишите наименьшее целое число x, для которого истинно высказывание: НЕ (x нечётное) И НЕ (x<24)

Нажмите на рекламу ниже и сразу увидите ответ
Популярные вопросы:
Ответ:
inferatu777
18.04.2023 03:08

Код:

#include <fstream>#include <cmath>void first_task(std::ifstream &cin, std::ofstream &cout) {    int n, k = 1; cin >> n >> k;    cout << n / k;}void second_task(std::ifstream &cin, std::ofstream &cout) {    int N; cin >> N;    cout << 2 * (N / 2 + 1);}void third_task(std::ifstream &cin, std::ofstream &cout) {    int N; cin >> N;    auto t = [](int c, int N){return c / (int) pow(10, N) % 10;};    cout << t(N, 2) + t(N, 1) + t(N, 0);}void fourth_task(std::ifstream &cin, std::ofstream &cout) {    int N; cin >> N;    for (int it = 0; it < log2(N); ++it) {        cout << pow(2, it) << " ";    }}void fifth_task(std::ifstream &cin, std::ofstream &cout) {    int h, a, b;    cin >> h >> a >> b;    int h0 = h - a, dx = a - b;    int g = 1 + h0/dx + (h0%dx + dx - 1)/dx;    if (g < 0)        cout << INFINITY;    else        cout << g;}int main() {    std::ifstream cin("input.txt");    std::ofstream cout("output.txt");    // Choose your function    int N = 0; // 0-4    void (*tasks[5]) (std::ifstream &, std::ofstream &) = {first_task, second_task, third_task, fourth_task, fifth_task};    tasks[N](cin, cout);    return 0;}
0,0(0 оценок)
Ответ:
7534558
03.05.2022 02:56
Программа:
const
  n = 5;
  m = 5;
 
var
  a: array[1..n, 1..m] of integer;
  i, j: integer;
 
function check(i: integer): boolean;
var j: integer;
begin
  check := false;
  j := 0;
  repeat
    inc(j);
    if a[i, j] < 0 then
    begin
      check := true;
      exit;
    end;
  until j = m;
end;
 
function search: integer;
var i: integer;
begin
  search := 0;
  i := 0;
  repeat
    inc(i);
    if not(check(i)) then
    begin
      search := i;
      exit;
    end;
  until i = n;
end;
 
begin
  writeln('Введите матрицу ', n, 'x', m,': ');
  i := 0;
  repeat
    j := 0;
    inc(i);
    repeat
      inc(j);
      read(a[i, j]);
    until j = m;
  until i = n;
  writeln('ответ: ', search);
end.
Пример работы программы:
Введите матрицу 5x5:
3 4 2 3 -2
3 -5 -7 -2 1
8 2 5 4 -4
0 1 2 3 4
1 7 2 -5 2
ответ: 4
* Примечание: Если во всех строках есть отрицательные элементы, то ответ будет 0 (можно изменить в самой процедуре)
0,0(0 оценок)
Полный доступ
Позволит учиться лучше и быстрее. Неограниченный доступ к базе и ответам от экспертов и ai-bota Оформи подписку
logo
Начни делиться знаниями
Вход Регистрация
Что ты хочешь узнать?
Спроси ai-бота