| ||||||||||
| 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<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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator