Solution - UVa Problem 272 - TEX Quotes



সল্যুশন্সঃ
#include<bits/stdc++.h>
using namespace std;
int main()
{
    char snts[1000000];
    int cnt=0;
    while(gets(snts))
    {
        for(int i=0; snts[i]; i++)
        {
            if(snts[i] == '\"')
            {
                cnt++;
                if(cnt%2 == 0) cout << "''";
                else cout << "\``";
            }
            else cout << snts[i];
        }
        cout << endl;
    }
    return 0;
}




Comments

Popular posts from this blog

Solution - Timus Problem 1293. Eniya

Solution - Codeforces Problem 327B - Hungry Sequence

Solution - Timus Problem 1409. Two Gangsters