Untitled

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

}