[STL训练]Train Problem I-题解(C++代码) ```cpp#includeusingnamespacestd;stacka;intn,print[100];charo1[100],o2[100];intmain(){while(scanf("%d%s%s",&n,o1,o2)!=EOF){inti=0, 题解列表 2020年01月20日 0 点赞 0 评论 932 浏览 评分:0.0
[STL训练]Train Problem I (C++代码) 思路:模拟使用一个栈来模拟整个判断过程分五种情况;1,当栈为空且In数组还没有遍历完时,直接入栈,in数组指针向后移2.当栈不空,栈顶元素与out数组当前元素相等时,出栈,Out数组指针后移3.栈不空,栈顶元素与Out数组当前元素不等,且in数组没遍历完时, 题解列表 2019年11月29日 0 点赞 0 评论 813 浏览 评分:9.6