//刚看刘汝佳的第二版紫书 1 #include <iostream> 2 #include <cstdio> 3 #include <cstring> 4 #include <cstdlib> 5 #include <cmath> 6 #include <algorithm> 7 #include <set> 8 #include <map> 9 #include <string> 10 #include <queue> 11 #include <stack> 12 #include <vector> 13 #include <fstream> 14 #include <cctype> 15 #define fi for (int i = 1; i <= n; ++i) 16 #define fj for (int j = 1; j <= m; ++j) 17 #define INF 0x3fffffff 18 #define pau system("pause") 19 #define printcolck printf("Time used = %.2fs\n", (double) clock() / CLOCKS_PER_SEC); 20 #define eps 1e-5 21 #define cin std::cin 22 #define cout std::cout 23 #define endl std::endl 24 25 const double pi = acos(-1.0); 26 const int max_n = 1e5 + 5; 27 typedef long long ll; 28 typedef std::pair<int, int> pii; 29 30 template<class Q> void getint(Q &res, char ch = getchar()) { 31 while (!isdigit(ch) && ch != ‘-‘) ch = getchar(); 32 bool flag = true; 33 if (‘-‘ == ch) flag = false, ch = getchar(); 34 for (res = 0; isdigit(ch); ch = getchar()) res = res * 10 + ch - 48; 35 if (!flag) res = -res; 36 } 37 void putint(int x) { 38 int i = 0, a[10]; 39 bool flag = true; 40 if (x < 0) { 41 flag = false; 42 x = -x; 43 } else if (x == 0) { 44 a[i++] = 0; 45 } 46 while (x > 0) { 47 a[i++] = x % 10; 48 x /= 10; 49 } 50 if (flag == false) putchar(‘-‘); 51 for (int j = i - 1; j >= 0; --j) putchar(a[i] + 48); 52 } 53 int mmax(int a, int b) {return a > b ? a : b;} 54 int mmin(int a, int b) {return a < b ? a : b;} 55 int gcd(int a, int b) {while (b) {b ^= a ^= b ^= a %= b;} return a;} 56 57 /*int parent[max_n], rank[max_n]; 58 void ini() { 59 for (int i = 1; i < 10001; ++i) { 60 parent[i] = i; 61 rank[i] = 0; 62 } 63 } 64 int find(int x) { 65 return x == parent[x] ? x : parent[x] = find(parent[x]); 66 } 67 void unite(int x, int y) { 68 x = find(x); 69 y = find(y); 70 if (x == y) return; 71 72 if (rank[x] < rank[y]) { 73 parent[x] = y; 74 } else { 75 parent[y] = x; 76 if (rank[x] == rank[y]) rank[x]++; 77 } 78 }*/ 79 80 //#define LOCAL 81 82 int main() { 83 #ifdef LOCAL 84 freopen("data.in", "r", stdin); 85 freopen("data.out", "w", stdout); 86 #endif // LOCAL 87 char c; 88 int t = 1; 89 while ((c = getchar()) != EOF) { 90 if (‘"‘ == c) { 91 if (t) printf("``"); 92 else printf("‘‘"); 93 t = !t; 94 } else { 95 putchar(c); 96 } 97 } 98 return 0; 99 }
时间: 2024-10-08 13:14:17