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

为什么呢

Posted by hh08028 at 2010-11-23 19:03:40
#include<iostream>
using namespace std;
int n;
char fuck[531441];
void cut(int y,int u)
{
	int i,k,h;
	int t=u-y;
	if(t==1)
	{
		return;
	}
	for(i=t/3;i<t/3*2;i++)
	{
		fuck[y+i]=' ';	
	}

	k=y+t/3*2;h=y+t;
	cut(k,h);
	
	k=y;h=y+t/3;
	cut(k,h);
	
}
int f(int x)
 {
     int s=1,i;
     for(i=0;i<x;i++)
         s*=3;
     return s;
 }

int main()
{
	int i;
	cin>>n;
	while(n!=-1)
	{	int u=f(n);
		
		for(i=0;i<u;i++)
		{
			fuck[i]='-';
		}

		cut(0,u);

		for(i=0;i<u;i++)
		{
		cout<<fuck[i];
		}
		cin>>n;
	}

	return 0;
}

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