Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
Re:code hereIn Reply To:code here Posted by:Essence_me at 2005-08-27 13:45:40 嗯,清空的时候只有map前面部分 i<3===>i<7 > #include <stdio.h> > #include <math.h> > > int size; > char map[7][800][800]; > void copy(int x,int y,int ii) > { > int i,j; > for(i=0;i<size;i++) > for(j=0;j<size;j++) > map[ii][i+x][j+y]=map[ii-1][i][j]; > } > int main() > { > > int i,j,k,n; > for(i=0;i<3;i++) > for(j=0;j<800;j++) > for(k=0;k<800;k++) > map[i][j][k]=' '; > map[0][0][0]='X'; > for(i=1;i<7;i++) > { > size=(int)pow(3,i-1); > copy(0,0,i); > copy(0,size*2,i); > copy(size,size,i); > copy(size*2,0,i); > copy(size*2,size*2,i); > } > while(1) > { > scanf("%d",&n); > if(n==-1)break; > if(n!=0) > { > size=(int)pow(3,n-1); > for(i=0;i<size;i++) > { > for(j=0;j<size;j++) > printf("%c",map[n-1][i][j]); > printf("\n"); > } > } > printf("-\n"); > } > } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator