Uva272

TEX Quotes UVA - 272

 1 #include<bits/stdc++.h>
 2 #define LL long long
 3 #define maxn 10005
 4 using namespace std;
 5 int tot,m,n,ans;
 6 int a[maxn];
 7 int main()
 8 {
 9     int c,q=1;
10     while((c=getchar())!=EOF)
11     {
12         if(c=='"')
13         {
14             printf("%s",q?"``":"''");
15             q=!q;
16         }
17         else
18             printf("%c",c);
19     }
20     return 0;
21 }

注意点:

getchar()返回值是int,因为EOF是int不是字符。getchar()读取下一个字符,可以读取空格。

posted @ 2019-05-20 23:24  zuiaimiusi  阅读(101)  评论(0编辑  收藏  举报