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:这么精彩的程序居然没有人跟贴,诡异.向您致敬~,用最简的(x%3+y%3)%2==0描述了该分形In Reply To:这么精彩的程序居然没有人跟贴,诡异.向您致敬~,用最简的(x%3+y%3)%2==0描述了该分形 Posted by:tzkq at 2010-07-27 18:16:56 > int i,n,k,x,y,t; > main(){ > for(;scanf("%d",&n)&&0<n;puts("-")){ > k=pow(3,n-1); > for(i=0;i<k*k;i++){ > for(x=i/k,y=i%k,t=n;--t&&(x%3+y%3)%2==0;x/=3,y/=3); > printf("%c%s",t?32:88,i%k<k-1?"":"\n"); > } > } > } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator