UVa 272 - TEX Quotes
来源:互联网 发布:室内平面设计软件下载 编辑:程序博客网 时间:2024/05/17 06:38
时间限制:3.000秒
题目链接:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=829&page=show_problem&problem=208
入门水题之一。
题目大意就是读入文本,要求把其中的英文双引号转换成对应的格式。英文双引号前后是没有区别的,而转换之后的双引号则是 ``' '的格式,所以需要特判一下。
#include <iostream>#include <string>using namespace std;int main() { string line; int t = 1; while(getline(cin, line)) { for(string::iterator it = line.begin(); it != line.end(); ++it) { if(*it == '"') { if(t) cout << "``"; else cout << "''"; t = !t; } else cout << *it; } cout << endl; }}
0 0
- Uva 272 - TEX Quotes
- UVa 272 - TEX Quotes
- UVA 272 - TEX Quotes
- uva 272 - TeX Quotes
- UVa 272 TEX Quotes
- UVa 272 - TEX Quotes
- UVA 272 - TEX Quotes
- UVA-272 TEX Quotes
- UVa 272 - TEX Quotes
- Uva-272TEX Quotes
- UVA - 272 TEX Quotes
- UVa 272 - TEX Quotes
- Uva 272 TEX Quotes
- UVA 272 TEX Quotes
- UVA 272 TEX Quotes
- Tex Quotes UVa 272
- UVa 272 TEX Quotes
- uva 272 TEX Quotes
- shell条件嵌套(if条件语句)
- WindowsPhone8.0异常处理记录
- 操作格子
- 自动装配学习心得
- 解决HanziToPinyin中Collator.getAvailableLocales()在小米、HTC One等手机上获取本地语言环境不匹配转换拼音失败BUG
- UVa 272 - TEX Quotes
- 用试探回溯法解决N皇后问题
- javax.servlet.ServletException: java.lang.NoClassDefFoundError:
- cocos2d-x js 显示状态栏 iOS Status Bar
- MongoDB索引的创建与删除
- 多线程编程4 - GCD
- 二维数组简单实现HashMap
- web安全测试设计----OWASP测试框架
- 21个故事