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 ...
随机推荐
- C++-函数模板特化如何避免重复定义
我正在用一个基于模板的库源代码,该库包含一些针对特定类型的模板函数特化.类模板,函数模板和模板函数特化都在头文件中.我在我的.cpp文件中 #include 头文件并编译链接工程.但是为了在整个工程 ...
- 最大公约数——Program G
最大公约数 Description There is a hill with n holes around. The holes are signed from 0 to n-1. A rabbit ...
- Jquery实现的Tabs标签页
效果图: HTML: <div class="tabs"> <ul id="tabs"> <li class="tab- ...
- SharePoint 2013 企业搜索架构示例
博客地址:http://blog.csdn.net/FoxDave 本文参考自微软官方的Chart,我们来看一下企业中对于不同规模SharePoint搜索的场的架构是什么样的. 对于搜索场的规模, ...
- SharePoint 2013 Nintex Workflow 工作流帮助(十三)
博客地址 http://blog.csdn.net/foxdave 工作流动作 35. Delegate Workflow Task(User interaction分组) 该操作将委托未处理的工作流 ...
- C# 调用配置文件SQL语句 真2B!
/********************************************************************************* ** File Name : SQ ...
- PHP 中的 9 个魔术方法
这个标题有点牵强因为php有不只9种魔术方法, 但是这些将会引导你使用php魔术方法一个好的开始.它可能魔幻,但是并不需要魔杖. 这些'魔术'方法拥有者特殊的名字,以两个下划线开始,表示这些方法在ph ...
- access手工注入
1.判断数据类型 and exists (select * from msysobjects) >0 and exists (select * from sysobjects) >0 一般 ...
- hdu 2047
PS:又是上课偷懒..去递推.. 代码: #include "stdio.h"#include "math.h"long long dp[55];long lo ...
- 极客DIY:开源WiFi智能手表制作
如果你喜欢拥有一款属于自己的无线手表,那么请不要错过,相信阅读完这篇文章对你会很有帮助. 硬件规格 ESP8266(32Mbit闪存) MPU-9250(陀螺仪传感器)以及 AK8963(内置磁力计) ...