Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream>
- #include <clocale>
- using namespace std;
- int main()
- {
- setlocale(LC_ALL, "rus");
- int n,m, k,t,sum=0,max;
- bool flag = 1;
- cout << "Введите кол-во строк и столбцов матрицы: ";
- cin >> n >> m;
- cout << endl;
- int** arr = new int *[n];
- for (int i = 0; i < n; ++i)
- arr[i] = new int[m];
- cout << "Введите элементы матрицы:"<<endl;
- for (int i = 0; i < n; i++){
- for (int j = 0; j < m; j++){
- cin >> arr[i][j];
- }
- }
- cout << endl;
- t = m;
- for (int j = 0; j < m; j++){
- for (int i = 0; i < n; i++){
- if (arr[i][j] == 0){
- t--;
- continue;
- }
- }
- }
- for (int i=0,j = 0; j < m-1 && i<n-1; i++,j++){
- if (arr[i][j] % 2 == 0 && arr[i][j]>=0){
- sum += arr[i][j];
- }
- max = sum;
- if ()
- }
- cout <<"Кол-во столбцов без нулей: "<< t << endl;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement