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 |
帮忙看一下,为什么WA#include <stdio.h> int k[20]={1,2,4,8,16,32,64,128,256,512,1024,2048,4096}; char s[10][10]={" /\\ ","/__\\"}; void f(int a,int b,int n) { if(n==0)printf("%c",s[a][b]); else if(a>=k[n]&&b<k[n+1])f(a-k[n],b,n-1); else if(a>=k[n])f(a-k[n],b-k[n+1],n-1); else if(b>=k[n]&&b<3*k[n])f(a,b-k[n],n-1); else printf(" "); } int main() { int i,j,n,t,m; scanf("%d",&t); while(t--) { scanf("%d",&n); for(i=0;i<k[n+1];i++) { for(j=0;j<k[2,n+2];j++) if(j<=k[2,n+1]+i)f(i,j,n); 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