Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Re:这么精彩的程序居然没有人跟贴,诡异.向您致敬~,用最简的(x%3+y%3)%2==0描述了该分形

Posted by 10110057 at 2013-08-12 20:01:58 on Problem 2083
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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator