C++ 代码
#include<iostream>
using namespace std;
int main()
{
int a,b;
cin >> a >> b;
for(int i =1;i<=a*b;i++)
{
if(i%b == 0)
{
cout<<"PUM"<<endl;
i +=1;
}
if(i == a*b+1) break;
cout << i << " ";
}
return 0;
}