TeX is a typesetting language developed by Donald Knuth. It takes source text together with a few typesetting instructions and produces, one hopes, a beautiful document. Beautiful documents use `` and " to delimit quotations, rather than the mundane"which is what is provided by most keyboards. Keyboards typically do not have an oriented double-quote, but they do have a left-single-quote`and a right-single-quote'. Check your keyboard now to locate the left-single-quote key`(sometimes called the ``backquote key") and the right-single-quote key'(sometimes called the ``apostrophe" or just ``quote"). Be careful not to confuse the left-single-quote`with the ``backslash" key\
. TeX lets the user type two left-single-quotes``to create a left-double-quote `` and two right-single-quotes''to create a right-double-quote ''. Most typists, however, are accustomed to delimiting their quotations with the un-oriented double-quote".
If the source contained
"To be or not to be," quoth the bard, "that is the question."
then the typeset document produced by TeX would not contain the desired form:
``To be or not to be," quoth the bard, ``that is the question."
In order to produce the desired form, the source file must contain the sequence:
``To be or not to be,'' quoth the bard, ``that is the question.''
You are to write a program which converts text containing double-quote (") characters into text that is identical except that double-quotes have been replaced by the two-character sequences required by TeX for delimiting quotations with oriented double-quotes. The double-quote (") characters should be replaced appropriately by either``if the"opens a quotation and by''if the"closes a quotation. Notice that the question of nested quotations does not arise: The first"must be replaced by``, the next by'', the next by``, the next by'', the next by``, the next by'', and so on.
Input and Output
Input will consist of several lines of text containing an even number of double-quote (") characters. Input is ended with an end-of-file character. The text must be output exactly as it was input except that:
- the first"in each pair is replaced by two`characters:``and
- the second"in each pair is replaced by two'characters:''.
Sample Input
"To be or not to be," quoth the Bard, "that is the question". The programming contestant replied: "I must disagree. To `C' or not to `C', that is The Question!"
Sample Output
``To be or not to be,'' quoth the Bard, ``that is the question''. The programming contestant replied: ``I must disagree. To `C' or not to `C', that is The Question!''
#define RUN #ifdef RUN #include <stdio.h> int main() { int c, q = 1; while((c= getchar()) != EOF) { if(c == '"') { printf("%s", q ? "``" : "''"); q = !q; } else printf("%c", c); } return 0; } #endif
相关推荐
股票行情查看 - Stock quotes_v1.0.6.crx
前端开源库-typographic-quotes排版引号,总是使用大引号
前端开源库-typographic-quotes-l10n-db排版-引号-l10n-db,关于排版引号的原始数据
资源来自pypi官网。 资源全名:flake8-single-quotes-0.1.0.tar.gz
单引号cli 将匹配的双引号转换为单引号: I "love" unicorns → I 'love' unicorns安装$ npm install --global to-single-quotes-cli用法$ to-single-quotes --help Usage $ to-single-quotes <string> $ echo ...
javascript-forex-quotes javascript-forex-quotes是用于获取实时外汇报价的Javascript库。 目录 要求 您可以从获得1Forge API密钥 安装 npm install forex-quotes --save 用法 导入客户端 // With require const...
安装 $ npm install --save movie-quotes用法 const movieQuotes = require ( 'movie-quotes' ) ;movieQuotes . random ( ) ;//=> 'Max'应用程序接口。全部类型: array 根据 AFI 排名前 100 名的最佳电影名言。。...
前端开源库-coffeelint-prefer-double-quotescofeelint更喜欢双引号,自定义cofeelint规则更喜欢双引号
入门$ npm i popular-movie-quotes --save安装 这是通过提供的模块。 在安装之前,请 使用命令完成 : $ npm i popular-movie-quotes --save用法 getAll()方法返回一个对象数组,每个对象包含quote和movie 。 { ...
php-forex-quotes php-forex-quotes是一个PHP库,用于获取实时外汇报价。 请参阅/ examples文件夹中的REST和WebSocket实现示例。 目录要求安装php-forex-quotes php-forex-quotes是一个PHP库,用于获取实时外汇报价...
$ npm install --global to-double-quotes-cli 用法 $ to-double-quotes --help Usage $ to-double-quotes $ echo <string> | to-double-quotes Example $ to-double-quotes "I love 'unicorns'" I love ...
用于开源项目的Programming Quotes API。 主页: Github: API文档 支持的语言:en,sr。 公共路线 GET (获取所有报价) GET (按语言获取报价) GET (按页获取报价) GET (获得随机报价) GET (按语言...
Quotes loader every day
安装npm install sun-tzu-quotes [--g | --save]例子该模块包含在API和CLI中。 代码示例: var sunTzu = require ( 'sun-tzu-quotes' )// random quoteconsole . log ( sunTzu ( ) )//=> 'All warfare is based on ...
Nic-Cage-random-quotes 当前给出分配给一个数字的报价。 去做: - 从文件中读取引号, - 随机报价。
swami-vivekananda-quotes-authentic.github.io
安装将React Forex报价添加到您的项目中: yarn add react-forex-quotes要使用外汇报价,请将其导入到您自己的组件中。 import ForexQuotes from 'react-forex-quotes';用法在使用ForexQuotes之前,请使用1Forge注册...
pebblekit-js-quotes 该应用程序展示了如何使用PebbleKit JS API从互联网上获取价格报价并将其显示在Pebble上。 使用按钮选择股票代码(例如Google的GOOG),然后检查价格是否合适。
语言:中文 (简体) 股票行情指数查看工具,上证,A股,港股,K线 股票行情查看,支持沪深股市A股实时股票信息,实时成交价格,沪深指数等等-------- v1.0.6 2021-2-27 --------1、修复搜索网络问题2、有任何问题与...
如何安装要在oh-my-zsh下安装hacker-quotes : 步骤1:将此存储oh-my-zsh到oh-my-zsh的plugins目录中: git clone https://github.com/oldratlee/hacker-quotes.git ~ /.oh-my-zsh/custom/plugins/hacker-quotes ...