【題解】 UVA 272 TeX 中的引號

目錄

 

題目描述

題意分析

AC代碼


題目描述

https://vj.e949.cn/41e0e34d61d7191aed9fc036c8405496?v=1542228492

題意分析

題意: 將雙引號替換

AC代碼

#include <cstdio>
#include <cmath>
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <cstdlib>
#include <map>
#include <list>
#include <stack>
#include <queue>
#include <string>
#include <cstring>
#include <memory.h>
#define MAXN 10005
#define INF 0x3f3f3f3f
using namespace std;
typedef long long ll;

int main()
{
    char temp;
    bool p=true;
    while( (temp=getchar())!=EOF )
    {
        if(temp!='"')
        {
            cout<<temp;
        }
        else
        {
            printf("%s",p?"``":"''");
            p=!p;
        }
    }
    return 0;
}

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章