#include <cmath>
#include <iomanip>
#include <stdio.h>
#include <iostream>
#include <stdlib.h>
#define M 4 //количество столбцов
int n; //количество строк
int **a; //двумерный массив
void create_sotr (int row, int col){
int i,j;
a = new int *[row];
for (i=0; i<row; i++){
a[i]=new int [col];
std::cout<<"Введите данные для " << i <<" -й строки \n";
for (j=0; j<col; j++)
{
std::cout <<"Введите данные для " << j << "-го стоблца ";
std::cin >> a[i][j];
}
}
}
void print_sotr (int row, int col){
int i,j;
for(i=0;i<row;i++){
for(j=0;j<col;j++){
std::cout << a[i][j];
}
}
}
int main() {
//std::cout << "Hello, World!\n";
std::cout <<"Введите количество строк ";
std::cin >> n;
create_sotr(n,M);
print_sotr(n,M);
for (int i=0; i<n; i++)
delete a[i];
return 0;
}
Если Вы уже зарегистрированы на Портале - войдите в систему, если Вы еще не регистрировались - пройдите простую процедуру регистрации.