AcWing 723. PUM
原题链接
简单
作者:
强者
,
2025-01-09 14:52:28
,
所有人可见
,
阅读 1
#include <iostream>
using namespace std;
int main()
{
/*
int N,M;
int i = 1,j = 1;
cin >> N >> M;
while (i >= 1 && i <= N) {
int j = 1;
while (j >= 1 && j <= M) {
if (j != M) {
cout << M *i - (M - j);
if (j < M) cout << " ";
} else {
cout << "PUM" << endl;
}
j += 1;
}
i += 1;
}
*/
int n,m;
cin >> n >> m;
for (int i = 0,k = 1;i < n;i ++)
{
for (int j = 0; j < m - 1; j ++)
{
cout << k << " ";
k++;
}
cout << "PUM" << endl;
k++;
}
return 0;
}