zoukankan      html  css  js  c++  java
  • Tex中的引号

    在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;
    }




    知识点:
    1
    int c;
    while(c=getchar)
    {
        cout<<char(c);
    可用来输入含有空格和回车的字符串
    头文件#include<stdio.h>


    h=!h  如果h=0,!h=1;
    如果h属于N+,!h等于0


    3
    while(a!=EOF)
    的意思:除非按下ctrl+z,否则就不会跳出循环,但在getchar()函数这里不知道为什么,EOF这句有没有都不起作用

  • 相关阅读:
    Oracle使用sys登录时报错ORA-28009解决方法
    oem的使用
    isqlplus的使用
    oracle客户端中文乱码问题的解决
    十:jinja2模板查找路径
    九:flask-response响应
    八:flask-重定向示例
    七:flask-一些小细节
    六:flask-自定义URL转换器
    五:flask-url_for使用详解
  • 原文地址:https://www.cnblogs.com/iamjuruo/p/7470980.html
Copyright © 2011-2022 走看看