Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<cmath>
- using namespace std;
- int **creat(int &n, int &m)
- {
- cout << "Введите количество строк: "; cin >> n;
- cout << "Введите количество столбцов: "; cin >> m;
- int **mas = new int*[n];
- for (int i = 0; i < n; ++i)
- mas[i] = new int[m];
- for (int i = 0; i < n; ++i)
- for (int j = 0; j < m; ++j)
- {
- cout << "mas[" << i << "][" << j << "]= ";
- cin >> mas[i][j];
- }
- return mas;
- }
- void print(int **mas, int n, int m)
- {
- for (int i = 0; i<n; ++i, cout << endl)
- for (int j = 0; j<m; ++j)
- cout << mas[i][j] << "\t";
- }
- int main()
- {
- setlocale(LC_ALL, "Russian");
- int n, m;
- int **a = creat(n, m);
- {
- for (int i = 0; i < n; ++i)
- {
- for (int j = 0; j < m; ++j)
- {
- {
- {
- {
- if (a[i][j]>0)
- cout << "Есть" << endl;
- else
- cout << "Hет" << endl; }
- break;
- }
- }
- }break;
- }
- }
- for (int i = 0; i < n; ++i)
- delete[] a[i];
- delete[] a;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement