C++ 代码
#include<iostream>
using namespace std;
int main()
{
int n, m, sum=1;
cin >> n >> m;
for ( int i = 0; i < n; i++ )
{
for ( int j = 0; j < m-1; j++, sum++)
cout << sum << " ";
cout << "PUM" << endl;
sum++;
}
return 0;
}