首页
DreamJudge
院校信息
专业题库
模拟考试
机试真题
408真题
专业课程
兑换中心
登录
注册
上岸
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
xiaowaya
2025年3月18日 16:56
模拟出入栈游戏 题解:
P1684
回复 0
|
赞 6
|
浏览 299
#include<bits/stdc++.h> #include<stack> using namespace std; bool isValid(string &str){ stack<char> s; int index=0; for(char i='a';i<='z';i++){ &n...
202110405235
2025年3月9日 20:24
模拟出入栈游戏 题解:
P1684
回复 0
|
赞 2
|
浏览 257
用c写的,有自己写的解析。 #include <stdio.h> #include <stdlib.h> #include<string.h> char arr[27]; int flag[26]={0};//标记数组 // 定义栈的结构体 typedef struct { char *array; // 指向动态分配的数组 int top; // 栈顶位置 int capacity; // 栈的容量 } Stack; // 创建一个栈 Stack* createStack(...
wudiyiyi
2020年4月16日 09:15
用栈模拟即可
P1684
回复 0
|
赞 17
|
浏览 10.6k
#include <bits/stdc++.h> using namespace std; char s[30]; stack<char> q; int main() { while(scanf("%s",s)!=EOF) { while(q.size()) q.pop(); int cnt=0; for(char i='a';i<='z';i++) { q.push(i); while(!q.empt...
题目
模拟出入栈游戏
题解数量
3
发布题解
在线答疑
热门题解
1
用栈模拟即可
2
模拟出入栈游戏 题解:
3
模拟出入栈游戏 题解: