#include <stdio.h>
#define N 3
int main()
{
void fun(int a[][N], int n);
int i, j, p, a[][N] = { {1,2,3},{4,5,6},{7,8,9} };
for (i = 0;i < N;i++)
{
for (j = 0;j < N;j++)
{
printf(" %d", a[i][j]);
}
printf("\n");
}
printf(“Please input an integer:\n”);
scanf("%d", &p);
fun(a,p);
printf("the result is:\n");
for (i = 0;i < N;i++)
{
for (j = 0;j < N;j++)
{
printf(" %d", a[i][j]);
}
printf("\n");
}
return 0;
}
void fun(int a[][N], int n)
{
int i, j;
for (i = 0;i < N;i++)
{
for (j = 0;j <= i;j++)
{
a[i][j]=a[i][j] * n;
}
}
}