完善下列程序每小题在PASCAL语言(a)和C语言(b)中任选一题下面的程序将数列…n*n依次按蛇型方式存放在二维数组A[nn]中即 (示意图编者略)
(a)算法的PASCAL 语言程序描述(编者略)(b)算法的C语言程序描述
#define NMAX
#include stdioh
main()
{ int ijnkpqm;
int a [NMAX][NMAX];
scanf(%d&n);
m=;
for(k=__()__ k++)
{if(k<n) q=k else__()__;
for(p=;p<=q;p++)
{if__()__ {i=qp+j=p}
else{i=pj=qp+}
if__()__ {i=i+nqj=j+nq}
a[i][j]=m__()__;
}
for(i=i<=n;i++)
{ for(j=j<=nj++)
printf(%da[i][j]);printf(\n);
}
}
}【上海大学 六 (分)】
[] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []