Tex中的引号
来源:互联网 发布:apache base64 编辑:程序博客网 时间:2024/05/16 11:12
在Tex中,做双引号的" `` ",右双引号是" '' "(两个回车左边的).输入一篇包含双引号的文章,你的任务是把它转换成TeX的格式。
样例输入:"To be or not to be,"quoth the Bard,"that
is the question".
样例输出:
``To be or not to be''quoth the Bard,``that
is the question''.
源代码:
#include<iostream>
#include<stdio.h>
using namespace std;
int main()
{
int c,h=1;
while((c=getchar())!=EOF)
{
if(c=='"')
{
if(h)
cout<<"``";
else
cout<<"''";
h=!h;
}
else
cout<<char(c);
}
return 0;
}
#include<iostream>
#include<stdio.h>
using namespace std;
int main()
{
int c,h=1;
while((c=getchar())!=EOF)
{
if(c=='"')
{
if(h)
cout<<"``";
else
cout<<"''";
h=!h;
}
else
cout<<char(c);
}
return 0;
}
知识点:
1
int c;
while(c=getchar)
while(c=getchar)
{
cout<<char(c);
}
可用来输入含有空格和回车的字符串
头文件#include<stdio.h>
2
h=!h 如果h=0,!h=1;
如果h属于N+,!h等于0
3
while(a!=EOF)
的意思:除非按下ctrl+z,否则就不会跳出循环,但在getchar()函数这里不知道为什么,EOF这句有没有都不起作用
0 0
- Tex中的引号
- TeX中的引号
- TeX中的引号
- TeX中的引号
- 例题3-1 TeX中的引号(TeX)
- UVa 272 Tex Quotes(TEX中的引号)
- TeX中的引号 (Tex Quotes, UVa 272)
- TeX中的引号(引号的转化)
- UVA 272 Tex中的引号
- 3-5TeX中的引号
- 【UVa】[272]TeX中的引号
- Tex中的引号(Uva 272)
- TeX中的引号(TeX Quote, UVa 272)
- Tex中的引号(UVa 272)
- 算法入门经典:TeX 中的引号
- 《算法竞赛入门经典2ndEdition 》例题3-1 TeX中的引号(Tex Quotes, Uva 272)
- TeX的引号(UVA272)
- 算法之路二:刘汝佳算法竞赛入门经典 3.5Tex中的引号 UVa272
- 软考程序员随笔-----7
- Android ListView、GridView等性能优化
- jsp页面 报core 找不到
- 2016 百度之星 B题(java实现)
- 新优麒麟版本发布PK微软Windows
- Tex中的引号
- VMWare虚拟机中的MacOSX使用XCode运行无法连接iPhone设备
- Failed to install Python Cryptography package
- 第2章:Android的编译环境--build系统
- EJB 3.*环境搭建小案例
- 编写XML文件
- Debug和Release区别
- 在WebLogic新建针对Oracle数据库的JNDI数据源
- 抽象类