UVA 272 TEX Quotes



#include 
#include 
#include 

using namespace std;

int main(int argc, char *argv[])
{
    string str;
    bool flag = true;
    while(getline(cin , str))
    {
        for(int i = 0 ; str[i] != '\0' ; i++){
            if(str[i] == '\"'){
                if(flag)
                    printf("``");
                else
                    printf("''");
                flag = !flag;
            }else{
                printf("%c",str[i]);
            }
        }
        printf("\n");
    }
    return 0;
}

你可能感兴趣的:(UVA 272 TEX Quotes)