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 |
其实反解析更有意思,就是第二种化成第一种static String p(String s){ if(s.length()==0)return ""; int t=s.charAt(s.length()-1)-48; if(t==s.length()) return '('+p(s.substring(0,s.length()-1))+')'; else return p(s.substring(0,s.length()-t))+p(s.substring(s.length()-t)); } java代码 递归思想 仅是把第二种化成括号形式 Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator