c语言二维整型数组
1个回答
展开全部
#include "stdio.h"
#include "stdlib.h"
#include "time.h"
#define N 7
int main(void){
int a[N][N],i,j;
srand((unsigned)time(NULL));
for(i=0;i<N;i++){
for(j=0;j<N;j++)
printf("%3d",a[i][j]=rand()%30);
printf("\n");
}
printf("\n");
for(i=0;i<N;i++){
for(j=0;j<N;printf("%3d",a[i][j++]))
if(j<=i) a[i][j]*=3;
printf("\n");
}
return 0;
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询