viptimoshe1
29.03.2022 18:15

дайте ответ на сор content://com.android.chrome.FileProvider/images/screenshot/1614587966898-1659521990.jpg

Нажмите на рекламу ниже и сразу увидите ответ
Популярные вопросы:
Ответ:
bettihorvath13
15.02.2023 15:30
#include <iostream>
#include <math.h>
#include <cstdlib>
using namespace std;

int main()
{
   int position = 0;

    int i,j, ch,a,s;
    int* mass = NULL;
    cout << "Заданное число А: ";
    cin >> a;

    while (1)

    {
        cin >> ch;
        if (ch == 0) break;
        mass = (int*)realloc(mass, (position+1)*sizeof(int));
        mass[position] = ch;
        position++;

    }
    s=0;
    j=0;
    for (i=0;i<position;i++){
        if (((mass[i] > 0) && (mass[i+1] > 0)) || ((mass[i] < 0) && (mass[i+1] < 0)))
            j++;
        if (((mass[i] > 0) && (mass[i] < a)))
            s++;
    }

    cout << "Номер поседней пары: " << j << endl;
    cout << "Положительно и не больше А: " << s << endl;

    return 0;
}
0,0(0 оценок)
Ответ:
virina059
08.01.2022 02:51
Возможный вариант в C++
#include <iostream>
int main()
{
    using namespace std;
    int N;
    cout << "Enter N: ";
    cin >> N;
    int num;
    int max = 1;
    int i;
    for (i = 0; i < N; ++i)
    {
        cout << "Enter #" << i + 1 << " number: ";
        cin >> num;
        if ((num - 9) % 10 != 0 && num % 3 == 0)
        {
            max = num;
            break;
        }
    }
    for (int j = i + 1; j < N; ++j)
    {
        cout << "Enter #" << j + 1 << " number: ";
        cin >> num;
        if ((num - 9) % 10 != 0 && num % 3 == 0)
            if (num > max)
                max = num;
    }
    if (max != 1)
        cout << "Max number div by 3 and don't end 9: " << max << endl;
    else
        cout << "No numbers div by 3 and don't end 9" << endl;
    return 0;
}
0,0(0 оценок)
Полный доступ
Позволит учиться лучше и быстрее. Неограниченный доступ к базе и ответам от экспертов и ai-bota Оформи подписку
logo
Начни делиться знаниями
Вход Регистрация
Что ты хочешь узнать?
Спроси ai-бота