• помогите написать программу на Си++.6 задание пожалуйста​

    question img

Ответы 1

  • #include<iostream>

    #include<cstdlib>

    #include<Windows.h>

    using namespace std;

    int main(){

    SetConsoleCP(1251);

    SetConsoleOutputCP(1251);

    const int n = 3;

    int arr[n][n];

    int ptr[n+20],max=0,ptr1[n+20];

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

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

      arr[i][j] = rand() % 100 + 1;

      cout << arr[i][j]<<" ";

     }

     cout << endl;

    }

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

     if (arr[i][1] > max) {

      max = arr[i][1];

     }

    }

    cout << "max = " << max << endl;

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

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

      if (arr[i][j] < max) {

       ptr[j] = i;

       ptr1[j] = j;

       cout << "Номер строки = " << i <<

        ", номер столбца = " << j << " элемента " <<

        arr[i][j] << " который меньше max = " << max << endl;

      }

     }

    }

    system("pause");

    return 0;

    }

  • Добавить свой ответ

Войти через Google

или

Забыли пароль?

У меня нет аккаунта, я хочу Зарегистрироваться

How much to ban the user?
1 hour 1 day 100 years