Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
342 B
0
Indexable
Never
#include <iostream>
using namespace std;
int main()
{
	int n=0,N,M;
	int mas[10][10];
	cin >> N >> M;
	for (int i = 0; i < N; i++) {
		for (int j = 0; j < M; j++)
		{
			mas[i][j] = n;
			n += 1;
		}
	}
	for (int i = 0; i < N; i++) {
		for (int j = 0; j < M; j++)
		{
			cout << mas[i][j]<<" ";
		}
		cout << endl;
	}
}