有没有大佬康康为什么只过了45啊 #include <iostream> (5488)#include <stack> using namespace std; int main() { int t; int jud = 1; cin >> t; while (t--) { stack<string>s; int n; jud = 1; string temp,temp2; cin >> n; for (int i = 0; i < n; i++) { cin >> temp; if (temp != "end") { s.push(temp); } else if(temp=="end") { cin >> temp2; if (!s.empty()&;&;temp2 == s.top()) { s.pop(); } else { jud = 0; break; } } } if (jud == 1&;&;s.empty()) { cout << "Yes"<<endl; } else { cout << "No"<< endl; } } return 0; }
点赞 3

相关推荐

28小凳也想实习:项目不用一个业务一个轮子吗,刷牛客好多人说要一业务一轮子
点赞 评论 收藏
分享
黑皮白袜臭脚体育生:简历统一按使用了什么技术实现了什么功能解决了什么问题或提升了什么性能指标来写会更好
点赞 评论 收藏
分享
牛客网
牛客企业服务