摘要:
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=1004 用到的主要是回溯,递归时先将所有字符放入栈中,在回溯时判断字符是否出栈并记录路径。栈是用字符数组模拟的。 另外这题的输出有点扯,每一行的最后一个i或o后面是有空格的,不需要处理,PE一次。code:#include<cstdio>#include<cstring>usingnamespacestd;charstr[50];charbstr[50],estr[50],ans[100];intblen,temp,h,r;voiddfs(intb 阅读全文