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