UVa 272 TEX Quotes

難題寫多了,來寫渣渣題。AC 0.020秒

#include<cstdio>
int main()
{
int c;
int inQuotes = 0;
while ((c = getchar()) != EOF)
{
if (c == '"')
{
if (inQuotes) //close quotes
{
putchar('\'');
putchar('\'');
}
else //start quotes
{
putchar('`');
putchar('`');
}
inQuotes = !inQuotes;
}
else
{
putchar(c);
}
}
return 0;
}
view raw 272.cpp hosted with ❤ by GitHub

留言

這個網誌中的熱門文章

UVa 10125 Sumsets

讀書心得: 撒哈拉的故事

讀書心得: 你以為你以為的就是你以為的嗎?