#include<stdio.h>
int main()
{
    int n,m,i,j,a[20][20];
    while(scanf("%d %d",&n,&m)!=EOF)
    {
        int t=1;
        for(i=0;i<n;i++)
        {
            for(j=0;j<m;j++)
            {
                a[i][j]=t;
                t++;
            }
        }
        
        for(i=0;i<n;i++)
        {
            for(j=0;j<m-1;j++)
            {
                printf("%d ",a[i][j]);
            }
            printf("%d\n",a[i][m-1]);
        }
    }
    return 0;
}

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-16
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-07
  • 2021-11-28
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案