特定字符序列的判断

 #include <iostream>
#include <cstdlib>
#include <stack>
#include <string>
using namespace std; int main()
{
stack<char> s;
stack<char> s1;
char c, c1;
string str;
cin>>str;
int i=;
while()
{
c = str[i];
if (c == '#')
{
break;
}
s.push(c);
i++;
} while()
{
c1 = s.top();
s.pop();
if (c1 == '@')
{
break;
}
s1.push(c1);
} if (s.size()!=s1.size())
{
cout<<"no!";
return ;
} while(!s.empty())
{
if(s.top()!=s1.top())
{
cout<<"no!";
return ;
}
s.pop();
s1.pop();
} cout<<"yes!"; return ;
}

SWUST OJ(1028)的更多相关文章

  1. [Swust OJ 404]--最小代价树(动态规划)

    题目链接:http://acm.swust.edu.cn/problem/code/745255/ Time limit(ms): 1000 Memory limit(kb): 65535   Des ...

  2. [Swust OJ 649]--NBA Finals(dp,后台略(hen)坑)

    题目链接:http://acm.swust.edu.cn/problem/649/ Time limit(ms): 1000 Memory limit(kb): 65535 Consider two ...

  3. SWUST OJ NBA Finals(0649)

    NBA Finals(0649) Time limit(ms): 1000 Memory limit(kb): 65535 Submission: 404 Accepted: 128   Descri ...

  4. [Swust OJ 1023]--Escape(带点其他状态的BFS)

    解题思路:http://acm.swust.edu.cn/problem/1023/ Time limit(ms): 5000 Memory limit(kb): 65535     Descript ...

  5. [Swust OJ 1125]--又见GCD(数论,素数表存贮因子)

    题目链接:http://acm.swust.edu.cn/problem/1125/ Time limit(ms): 1000 Memory limit(kb): 65535   Descriptio ...

  6. [Swust OJ 1126]--神奇的矩阵(BFS,预处理,打表)

    题目链接:http://acm.swust.edu.cn/problem/1126/ Time limit(ms): 1000 Memory limit(kb): 65535 上一周里,患有XX症的哈 ...

  7. [Swust OJ 1026]--Egg pain's hzf

      题目链接:http://acm.swust.edu.cn/problem/1026/     Time limit(ms): 3000 Memory limit(kb): 65535   hzf ...

  8. Light OJ 1028 - Trailing Zeroes (I) (数学-因子个数)

    题目链接:http://www.lightoj.com/volume_showproblem.php?problem=1028 题目大意:n除了1有多少个因子(包括他本身) 解题思路:对于n的每个因子 ...

  9. [Swust OJ 1139]--Coin-row problem

    题目链接:  http://acm.swust.edu.cn/contest/0226/problem/1139/ There is a row of n coins whose values are ...

随机推荐

  1. 微信小程序如何实现点击链接跳转到手机自带浏览器

    最近遇到一个需求.公司有一个业务,制作的小程序需要跳出微信打开一个指定的我们自己的页面,拿到这个需求后我们团队分开去找资料研究方案,通过微信的开发文档.腾讯的第三方开发文档我们都查阅过资料但是最终只找 ...

  2. Nodejs使用robot操作鼠标键盘

    1.安装robotjs库 前提是配置了cnpm cnpm i robotjs -g   2.如果报错VCBuild.exe,如下可以安装windows-tool MSBUILD : error MSB ...

  3. vector创建二位数组

    默认初始化vector vector<vevtor<int> > arr(row, vector<int>(col, 0)); //指定行大小为row,列为col, ...

  4. vue2.x入坑总结—回顾对比angularJS/React的一统

    从感性的角度讲,我是不屑于用VUE,觉得react套件用起来更顺手,但是vue现在越来火,所以也不得入vue(杂烩汤)的坑.vue/anguarJS/React,三者对关系现在就是: https:// ...

  5. AD域详解

    很详细,赞!

  6. github文件上传与下载

    一.文件上传 ①.注册并登陆github,进入Github首页,点击New repository新建一个项目. ②.填写相应信息后点击create即可 Repository name: 仓库名称 De ...

  7. jQuery和react实现二维码

    jq如何生成二维码 代码如下: 1.jquery.qrcode生成二维码代码 <!DOCTYPE html> <html> <head> <script ch ...

  8. 兼容ie8总结

    最近做了个兼容ie8的项目,把遇到的一些坑总结一下,欢迎大神指正,共勉. 一. js相关 1.  关于库的引用 jquery只能引用1.x的版本,swiper只能引用2.x的版本. 2. 动态生成的d ...

  9. scrapy的splash 的简单使用

    安装Splash(拉取镜像下来)docker pull scrapinghub/splash安装scrapy-splashpip install scrapy-splash启动容器docker run ...

  10. Oracle的问题的解决

    关于数据库的数据的导入导出       1.建数据库 修改密码的有效天数为无限期.       2.建表空间       3.建用户 导数据之前要建用户 要登进去试试 如themis_yw themi ...