Uva-272 TEX Quotes

容易题,考察字符串。

#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
    char a;
    int cnt=0;
    while(scanf("%c",&a)==1)
    {
        if(a=='"')
        {
            ++cnt;
            if(cnt%2==1) cout<<"``";
            else cout<<"''";
        }
        else cout<<a;
    }
    return 0;
}

版权声明:本文为博主原创文章,未经博主允许不得转载。

原文地址:https://www.cnblogs.com/windrises/p/4653070.html