UVA

来源:互联网 发布:淘宝韩国女模特 编辑:程序博客网 时间:2024/06/05 17:55
//入门经典P47 水题#include <cstdio>int main(){int c, q = 1;while ((c = getchar()) != EOF){if (c == '"'){printf("%s", q?"``":"''");q = 1 - q;}else printf("%c", c);}return 0;}/*#include <iostream>#include <cstdio>using namespace std;int main(){int c, j = 1;while ((c = getchar()) != EOF){if (c == '"'){cout << (j?"``":"''");j = !j;}elsecout << (char)c;}return 0;}*/

原创粉丝点击