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 |
各位帮忙看看啊·~到底哪里错啦·~#include<stdio.h> #include<math.h> char a[11][1025][2051]; int main() { // freopen("in.txt","r",stdin); // freopen("out.txt","w",stdout); a[1][1][2]='/'; a[1][1][3]='\\'; a[1][2][1]='/'; a[1][2][2]='_'; a[1][2][3]='_'; a[1][2][4]='\\'; int i,j,k,n,col,row,m; for(n=2; n<=10; n++) { col=pow((double)2,(double)n); row=col/2; // printf("%d\n",col); for(i=1; i<=row; i++) for(j=1; j<=col; j++) a[n][i][j+col/2]=a[n-1][i][j]; for(i=1; i<=row; i++) for(j=1; j<=col; j++) a[n][i+row][j]=a[n-1][i][j]; for(i=1; i<=row; i++) for(j=1; j<=col; j++) a[n][i+row][j+col]=a[n-1][i][j]; } while(scanf("%d",&m)==1 &&m) { col=pow((double)2,(double)(m+1)); row=col/2; for(i=1; i<=row; i++) { for(j=1; j<=col/2+i; j++) printf("%c",a[m][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