#include<stdio.h>
#include<windows.h>
#define N 10
void main()
{ int a[N]={0,1,2,3,4,5,6,7,8,9};
int b[N]={9,0,1,2,3,4,5,6,7,8};
int c[N]={8,9,0,1,2,3,4,5,6,7};
int d[N]={7,8,9,0,1,2,3,4,5,6};
int e[N]={6,7,8,9,0,1,2,3,4,5};
int f[N]={5,6,7,8,9,0,1,2,3,4};
int g[N]={4,5,6,7,8,9,0,1,2,3};
int x[N]={3,4,5,6,7,8,9,0,1,2};
int y[N]={2,3,4,5,6,7,8,9,0,1};
int z[N]={1,2,3,4,5,6,7,8,9,0},i,flag=1;
system("pause");
while(flag)
{ for(i=0;i<N;i++)printf("%d",a[i]);printf("\n");system("cls");
for(i=0;i<N;i++)printf("%d",b[i]);printf("\n");system("cls");
for(i=0;i<N;i++)printf("%d",c[i]);printf("\n");system("cls");
for(i=0;i<N;i++)printf("%d",d[i]);printf("\n");system("cls");
for(i=0;i<N;i++)printf("%d",e[i]);printf("\n");system("cls");
for(i=0;i<N;i++)printf("%d",f[i]);printf("\n");system("cls");
for(i=0;i<N;i++)printf("%d",g[i]);printf("\n");system("cls");
for(i=0;i<N;i++)printf("%d",x[i]);printf("\n");system("cls");
for(i=0;i<N;i++)printf("%d",y[i]);printf("\n");system("cls");
for(i=0;i<N;i++)printf("%d",z[i]);printf("\n");system("cls");}}
笨办法
还可以用多维数组实现,基本思路和这个一样