POJ 1488 Tex Quotes --- 水题
题目大意:给定一篇文章,将它的左引号转成 ``(1的左边),右引号转成 ''(两个 ' )
解题思路:水题,设置一个bool变量标记是左引号还是右引号即可
/* POJ 1488 Tex Quotes --- 水题 */
#include <cstdio>
#include <cstring> int main()
{
#ifdef _LOCAL
freopen("D:\\input.txt", "r", stdin);
#endif char c;
bool flag = ;
while ((c = getchar()) != EOF) {
if ('"' == c){
printf("%s", flag ? "''" : "``");
flag = !flag;
}
else{
putchar(c);
}
} return ;
}
POJ 1488 Tex Quotes --- 水题的更多相关文章
- UVa 272 Tex Quotes --- 水题
题目大意:在TeX中,左引号是 ``,右引号是 ''.输入一篇包含双引号的文章,你的任务是把他转成TeX的格式 解题思路:水题,定义一个变量标记是左引号还是右引号即可 /* UVa 272 Tex Q ...
- POJ 1488 - TEX Quotes
Description TEX is a typesetting language developed by Donald Knuth. It takes source text together w ...
- POJ 3641 Oulipo KMP 水题
http://poj.org/problem?id=3461 直接KMP就好.水题 #include<cstdio> #include<cstring> const int M ...
- poj 1006:Biorhythms(水题,经典题,中国剩余定理)
Biorhythms Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 110991 Accepted: 34541 Des ...
- poj 1002:487-3279(水题,提高题 / hash)
487-3279 Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 236746 Accepted: 41288 Descr ...
- poj 1003:Hangover(水题,数学模拟)
Hangover Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 99450 Accepted: 48213 Descri ...
- poj 2105 IP Address(水题)
一.Description Suppose you are reading byte streams from any device, representing IP addresses. Your ...
- poj 2000 Gold Coins(水题)
一.Description The king pays his loyal knight in gold coins. On the first day of his service, the kni ...
- POJ 3673 Cow Multiplication (水题)
题意:给你两个数,求所有的数位的积的和. 析:太水了,没的说,可以先输入边算,也可以最后再算,一样.. 代码如下: #include <cstdio> #include <strin ...
随机推荐
- Linux-VLAN
Why Vlan? VLAN是为解决以太网的广播问题和安全性而提出的一种协议,它在以太网帧的基础上增加了VLAN头,用VLAN ID把用户划分为更小的工作组,限制不同工作组间的用户二层互访,每个工作组 ...
- raspbian 静态IP
edit file: /etc/network/interfaces change line: iface eth0 inet dhcp iface eth0 inet static address ...
- [C/C++]C/C++相关网站
1.http://en.cppreference.com What is the purpose of this site? Our goal is to provide programmers wi ...
- VMWare Workstation 10.0 Preview CN
What's New in the VMware Workstation Technology Preview July 2013 The VMware Workstation team is exc ...
- In p = new Fred(), does the Fred memory “leak” if the Fred constructor throws an exception?
No. If an exception occurs during the Fred constructor of p = new Fred(), the C++ language guarantee ...
- Node.js的简介和安装
一.Node.js的简介和安装 a) 什么是Node.js? Node.js是一个开发平台 让JavaScript运行在服务器端的开发平台 ---简单点说就是用JavaScript写服务器 ...
- (spring-第1回【IoC基础篇】)Spring容器中Bean的生命周期
日出日落,春去秋来,花随流水,北雁南飞,世间万物皆有生死轮回.从调用XML中的Bean配置信息,到应用到具体实例中,再到销毁,Bean也有属于它的生命周期. 人类大脑对图像的认知能力永远高于文字,因此 ...
- KeySweeper 微软无线键盘嗅探装置
Author:Samy Kamkar From: http://samy.pl/keysweeper/ 中文字幕由Galaxy无名提供 PS:视频传到youku之后发现50秒左右的字幕被干掉了,不知道 ...
- 爬虫学习----pattern
1.match match(string[, pos[, endpos]]) | re.match(pattern, string[, flags]): 这个方法将从string的pos下标处起尝试匹 ...
- 实现:TextView自由复制功能
源代码已经上传,链接地址:http://download.csdn.net/detail/huangyabin001/7556825 点击打开链接 package com.example.copyfr ...