hdu 1870
水题。。。。
AC代码:
#include <iostream>
#include <queue>
using namespace std;
int main()
{
char str[1010];
int i,k;
while(scanf("%s",&str)!=EOF)
{
queue<char>q;
for(i=0;str[i]!='B';i++)
{
if(str[i]=='(')
q.push(str[i]);
if(str[i]==')')
q.pop();
}
printf("%d\n",q.size());
}
return 0;
}
hdu 1870的更多相关文章
- HDU 1870 愚人节的礼物
题解:简单的数括号问题…… #include <cstdio> char s[1005]; int main(){ while(scanf("%s",s)!=EOF){ ...
- HDU题解索引
HDU 1000 A + B Problem I/O HDU 1001 Sum Problem 数学 HDU 1002 A + B Problem II 高精度加法 HDU 1003 Maxsu ...
- HDU——PKU题目分类
HDU 模拟题, 枚举1002 1004 1013 1015 1017 1020 1022 1029 1031 1033 1034 1035 1036 1037 1039 1042 1047 1048 ...
- HDU 1043 & POJ 1077 Eight(康托展开+BFS+预处理)
Eight Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 30176 Accepted: 13119 Special ...
- hdu 1043 Eight 经典八数码问题
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1043 The 15-puzzle has been around for over 100 years ...
- hdu 1043 pku poj 1077 Eight (BFS + 康拓展开)
http://acm.hdu.edu.cn/showproblem.php?pid=1043 http://poj.org/problem?id=1077 Eight Time Limit: 1000 ...
- [转] HDU 题目分类
转载来自:http://www.cppblog.com/acronix/archive/2010/09/24/127536.aspx 分类一: 基础题:1000.1001.1004.1005.1008 ...
- HDU ACM 题目分类
模拟题, 枚举1002 1004 1013 1015 1017 1020 1022 1029 1031 1033 1034 1035 1036 1037 1039 1042 1047 1048 104 ...
- HDU 1043 Eight(八数码)
HDU 1043 Eight(八数码) 00 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Problem Descr ...
随机推荐
- python of zip moudle
reprinted:http://www.cnblogs.com/beginman/archive/2013/03/14/2959447.html A. code talk is cheap ,sho ...
- Js仿弹框
收藏一个简单实用的JS弹框,通过隐藏和显示div来实现,代码来自脚本之家! <html> <head> <title> LIGHTBOX EXAMPLE </ ...
- 编写可维护的javascript代码--- 2015.11.22(注释)
1.单行注释 // 这是一句单行注释 2.多行注释 /* 这里是代码 */ /* 这里都是注释 1232132 */ java的注释风格 /* * 另一段注释 * 这段注释包含2 ...
- ppt怎么换背景图片|PPT换背景设置方法
PPT怎么换背景?PPT背景可谓是PPT幻灯片的灵魂,优美绚丽的PPT背景能为自己做的PPT幻灯片锦上添花.今天,格子啦小编就教大家PPT换背景的方法,让你不再羡慕别人所做PPT的美丽背景,也可以自己 ...
- setNeedsDisplay 和 setNeedsLayout-b
setNeedsDisplay: Marks the receiver’s entire bounds rectangle as needing to be redrawn. drawRect: Th ...
- pojShredding Company
http://poj.org/problem?id=1416 #include<cstdio> #include<cstring> #define MAXN 100 using ...
- ISO14443-4块传输的实现(卡)
贴上自己的代码,目前测试通过,但我感觉结构不是很好,希望和大家交流共同提高. .H文件 #define ACKN -1 #define ACKY -2 #define RESEND -3 #defin ...
- 一个修改过简化版的InputQuery(简单实用,用到了Canvas)
主要是觉得在单输入的情况下, 原来InputQuery输入框左边的文本太难看了...... function _InputQuery(const ACaption: string; const APr ...
- POJ1260 Pearls(dp,矩阵链乘法)
题目链接. 题目大意: 给定一个n,和两个序列a[i], p[i]. a[i] 表示需要购买 i品质 的数量,p[i] i 等级的价格. 1.每个品质都会有不同的价格,价格依据品质上升而上升 2.买一 ...
- LVS安装配置
LVS安装部署 一.LVS安装(CENTOS) 1.LVS模块ip_vs已经内置在LINUX内核中,一般情况下ip_vs并没有启动,可以通过lsmod | grep ip_vs查看,能够看到信息表示模 ...