#define NUM 3
int data0[NUM][NUM];
int data1[NUM][NUM];
int data2[NUM][NUM];
int main(int argc, char* argv[])
{
int i,j;
printf("Berfore convert:\n");
for(i=0;i for(j=0;j data0[i][j]=i*NUM+j;
printf("%d ",data0[i][j]);
}
printf("\n");
}
for(i=0;i for(j=0;j data1[i][j]=data0[j][(NUM-1)-i];//逆时针旋转90度
data2[i][j]=data0[(NUM-1)-j][i];//顺时针旋转90度
}
}
printf("After convert N90\n");
for(i=0;i for(j=0;j //data0[i][j]=i*num+j;
printf("%d ",data1[i][j]);
}
printf("\n");
}
printf("After convert S90\n");
for(i=0;i for(j=0;j //data0[i][j]=i*num+j;
printf("%d ",data2[i][j]);
}
printf("\n");
}
while(1);
return 0;
}
阅读(940) | 评论(0) | 转发(0) |