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 |
参考递归函数!char str[531442]; 递归入口 loop=pow(3,n); memset(str,'-',loop); re(str,n); 递归函数 void re(char *s,int n) { if(n==1) { s[1]=' '; return; } int loop=pow(3,n-1); for(int i=0;i<loop;i++) { s[loop+i]=' '; } re(s,n-1); re(&s[loop+loop],n-1); } 注意要特殊处理0的情况 Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator