buggy_code
stringlengths
11
625k
fixed_code
stringlengths
17
625k
bug_type
stringlengths
2
4.45k
language
int64
0
8
token_count
int64
5
200k
change_count
int64
0
100
#include <stdio.h> int main() { unsigned int a, b, x, y; unsigned int rem; while (scanf("%d %d", &a, &b) != EOF) { x = a; y = b; while (b != 0) { if (a < b) { int tmp = a; a = b; b = tmp; } rem = a % b; a = b; b = rem; } } printf("%d %d\n", a, x * (y / a)); return 0; }
#include <stdio.h> int main() { unsigned int a, b, x, y; unsigned int rem; while (scanf("%d %d", &a, &b) != EOF) { x = a; y = b; while (b != 0) { if (a < b) { int tmp = a; a = b; b = tmp; } rem = a % b; a = b; b = rem; } printf("%d %d\n", a, x * (y / a)); } return 0; }
[["-", 0, 14, 8, 9, 0, 52, 8, 9, 0, 46], ["+", 0, 14, 8, 9, 0, 52, 8, 9, 0, 46]]
0
113
2
#include <stdio.h> int main() { int x, y, z; while ((scanf("%d %d", &x, &y)) != EOF) { if (x < y) { z = x; x = y; y = z; } int koyaku = gojo(x, y); long int koubai = (x / y) * koyaku; printf("%d %d\n", koyaku, koubai); } return 0; } int gojo(int x, int y) { int r; while ((r = x % y) != 0) { x = y; y = r; } return y; }
#include <stdio.h> int main() { int x, y, z; while (scanf("%d %d", &x, &y) != EOF) { if (x < y) { z = x; x = y; y = z; } int koyaku = gojo(x, y); long int koubai = (x / koyaku) * y; printf("%d %d\n", koyaku, koubai); } return 0; } int gojo(int x, int y) { int r; while ((r = x % y) != 0) { x = y; y = r; } return y; }
[["-", 0, 52, 15, 23, 0, 16, 31, 23, 0, 24], ["-", 0, 52, 15, 23, 0, 16, 31, 23, 0, 25], ["-", 49, 50, 51, 16, 31, 23, 0, 16, 12, 22], ["+", 49, 50, 51, 16, 31, 23, 0, 16, 12, 22], ["-", 8, 9, 0, 43, 49, 50, 51, 16, 12, 22], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 12, 22]]
0
132
6
#include <stdio.h> int gcd(int x, int y) { if (y == 0) return x; else return gcd(y, x % y); } int main() { int x, y, z; while (scanf("%d %d", &x, &y) != -1) z = gcd(x, y), printf("%d %d\n", z, x * y / z); return 0; }
#include <stdio.h> int gcd(int x, int y) { if (y == 0) return x; else return gcd(y, x % y); } int main() { int x, y, z; while (scanf("%d %d", &x, &y) != -1) z = gcd(x, y), printf("%d %d\n", z, y / z * x); return 0; }
[["-", 12, 2, 3, 4, 0, 16, 31, 16, 31, 22], ["-", 12, 2, 3, 4, 0, 16, 31, 16, 17, 48], ["+", 0, 34, 12, 2, 3, 4, 0, 16, 17, 48], ["+", 0, 34, 12, 2, 3, 4, 0, 16, 12, 22]]
0
91
4
#include <stdio.h> int main(void) { int a, b, x, y, num, tmp, big, small; while (scanf("%d%d", &x, &y) != EOF) { a = x; b = y; if (a < b) { tmp = a; a = b; b = tmp; } while (b != 0) { num = a % b; a = b; b = num; } small = a; big = x * y / small; printf("%d %d\n", small, big); } return 0; }
#include <stdio.h> int main(void) { long a, b, x, y, num, tmp, big, small; while (scanf("%ld %ld", &x, &y) != EOF) { a = x; b = y; if (a < b) { tmp = a; a = b; b = tmp; } while (b != 0) { num = a % b; a = b; b = num; } small = a; big = x * y / small; printf("%ld %ld\n", small, big); } return 0; }
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 0, 16, 31, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 16, 31, 2, 3, 4, 0, 5, 0, 6], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
0
122
6
// AOJ #include <stdio.h> int main() { int a, b, r, t, aa, bb; while (scanf("%d %d", &a, &b) != EOF) { aa = a; bb = b; while (1) { if (a < b) { t = a; a = b; b = t; } r = a % b; if (r == 0) break; a = r; } printf("%d %d\n", b, aa * bb / b); } return 0; }
// AOJ #include <stdio.h> int main() { int a, b, r, t, aa, bb; while (scanf("%d %d", &a, &b) != EOF) { aa = a; bb = b; while (1) { if (a < b) { t = a; a = b; b = t; } r = a % b; if (r == 0) break; a = r; } printf("%d %d\n", b, aa * (bb / b)); } return 0; }
[["+", 0, 2, 3, 4, 0, 16, 12, 23, 0, 24], ["+", 0, 2, 3, 4, 0, 16, 12, 23, 0, 25]]
0
112
2
#include <stdio.h> int main(void) { int x, y; int x2, y2; int i, j; int n; int gcd, lcm; while (scanf("%d %d", &x, &y) != EOF) { x2 = x; y2 = y; while (i != 0) { i = x % y; gcd = y; x = y; y = i; } lcm = (x2 / gcd) * y2; printf("%d %d\n", gcd, lcm); } return (0); }
#include <stdio.h> int main(void) { int x, y; int x2, y2; int i, j; int n; int gcd, lcm; while (scanf("%d %d", &x, &y) != EOF) { x2 = x; y2 = y; i = 1; while (i != 0) { i = x % y; gcd = y; x = y; y = i; } lcm = (x2 / gcd) * y2; printf("%d %d\n", gcd, lcm); } return (0); }
[["+", 0, 52, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 12, 13], ["+", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35]]
0
112
4
#include <iostream> #include <stdio.h> #include <string.h> using namespace std; long long cc(long long q, long long p) { if (q % p == 0) { return p; } else return cc(p, q % p); } main() { long long x, y, a[1000], b[1000]; int i = 0; while (scanf("%lld%lld", &x, &y) != EOF) { a[i] = cc(x, y); b[i] = x * y / a[i]; i++; } for (int j = 0; j < i; j++) { printf("%lld %lld\n", a[i], b[i]); } }
#include <iostream> #include <stdio.h> #include <string.h> using namespace std; long long cc(long long q, long long p) { if (q % p == 0) { return p; } else return cc(p, q % p); } main() { long long x, y, a[1000], b[1000]; int i = 0; while (scanf("%lld%lld", &x, &y) != EOF) { a[i] = cc(x, y); b[i] = x * y / a[i]; i++; } for (int j = 0; j < i; j++) { printf("%lld %lld\n", a[j], b[j]); } }
[["-", 0, 2, 3, 4, 0, 69, 341, 342, 0, 22], ["+", 0, 2, 3, 4, 0, 69, 341, 342, 0, 22]]
1
156
4
#include <bits/stdc++.h> using namespace std; int gcd(int a, int b) { return b != 0 ? gcd(b, a % b) : a; } int a, b; int main() { while (~scanf("%d%d", &a, &b)) { printf("%d %d\n", gcd(a, b), a * b / gcd(a, b)); } return 0; }
#include <bits/stdc++.h> using namespace std; int gcd(int a, int b) { return b != 0 ? gcd(b, a % b) : a; } int a, b; int main() { while (~scanf("%d%d", &a, &b)) { printf("%d %d\n", gcd(a, b), (long long)a * b / gcd(a, b)); } return 0; }
[["+", 3, 4, 0, 16, 31, 16, 31, 74, 0, 24], ["+", 31, 16, 31, 74, 39, 77, 39, 86, 0, 96], ["+", 3, 4, 0, 16, 31, 16, 31, 74, 0, 25]]
1
91
4
#include <iostream> #include <utility> using namespace std; int main() { int a, b; while (cin >> a >> b) { if (a > b) swap(a, b); int A = a, B = b; while ((a % A != 0) && (b % A != 0)) { --A; } while ((B % a != 0) && (B % b != 0)) { B += A; } cout << A << B << endl; } return 0; }
#include <iostream> #include <utility> using namespace std; int main() { int a, b; while (cin >> a >> b) { if (a > b) swap(a, b); int A = a, B = b; while ((a % A != 0) || (b % A != 0)) { --A; } while ((B % a != 0) || (B % b != 0)) { B += A; } cout << A << ' ' << B << endl; } return 0; }
[["-", 8, 9, 0, 52, 15, 339, 51, 16, 17, 98], ["+", 8, 9, 0, 52, 15, 339, 51, 16, 17, 106], ["+", 0, 1, 0, 16, 31, 16, 31, 16, 17, 151], ["+", 0, 16, 31, 16, 31, 16, 12, 103, 0, 104], ["+", 0, 16, 31, 16, 31, 16, 12, 103, 0, 125]]
1
109
8
#include <algorithm> #include <iostream> #include <limits> #include <math.h> #include <numeric> #include <stdio.h> #include <stdlib.h> #include <string> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define in(x) cin >> x #define out(str) cout << str << endl template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; } int gcd(int a, int b) { return b != 0 ? gcd(b, a % b) : a; } int lcm(int a, int b) { return a / gcd(a, b) * b; } int a, b; int main() { while (cin >> a >> b) { cout << gcd(a, b) << " " << lcm(a, b); } }
#include <algorithm> #include <iostream> #include <limits> #include <math.h> #include <numeric> #include <stdio.h> #include <stdlib.h> #include <string> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define in(x) cin >> x #define out(str) cout << str << endl template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; } int gcd(int a, int b) { return b != 0 ? gcd(b, a % b) : a; } int lcm(int a, int b) { return a / gcd(a, b) * b; } int a, b; int main() { while (cin >> a >> b) { cout << gcd(a, b) << " " << lcm(a, b) << endl; } }
[["+", 0, 52, 8, 9, 0, 1, 0, 16, 17, 151], ["+", 0, 52, 8, 9, 0, 1, 0, 16, 12, 22]]
1
207
2
#include <bits/stdc++.h> using namespace std; int main(void) { int a, b, x, y, r; while (1) { cin >> a >> b; if (cin.eof()) break; x = a; y = b; while (1) { if (b > a) swap(a, b); r = a % b; if (r == 0) break; a = b; b = r; } cout << b << " " << x * y / b << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; int main(void) { int a, b, x, y, r; while (1) { cin >> a >> b; if (cin.eof()) break; x = a; y = b; while (1) { if (b > a) swap(a, b); r = a % b; if (r == 0) break; a = b; b = r; } cout << b << " " << (long long)x * y / b << endl; } return 0; }
[["+", 31, 16, 12, 16, 31, 16, 31, 74, 0, 24], ["+", 31, 16, 31, 74, 39, 77, 39, 86, 0, 96], ["+", 31, 16, 12, 16, 31, 16, 31, 74, 0, 25]]
1
114
4
#include <bits/stdc++.h> using namespace std; long long kpk(long long n, long long m) { long long a, b; a = n; b = m; while (a != b && b != a) { while (a < b) { a += n; } while (b < a) { b += m; } } return b; } long long fpb(long long n, long long m) { int r; if (n < m) { swap(n, m); } r = n % m; while (r > 0) { n = m; m = r; r = m % m; } return m; } int main() { long long a, b; while (cin >> a >> b) { cout << fpb(a, b) << ' ' << kpk(a, b) << endl; } }
#include <bits/stdc++.h> using namespace std; long long kpk(long long n, long long m) { long long a, b; a = n; b = m; while (a != b && b != a) { while (a < b) { a += n; } while (b < a) { b += m; } } return b; } long long fpb(long long n, long long m) { long long r; if (n < m) { swap(n, m); } r = n % m; while (r > 0) { n = m; m = r; r = n % m; } return m; } int main() { long long a, b; while (cin >> a >> b) { cout << fpb(a, b) << ' ' << kpk(a, b) << endl; } }
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 8, 9, 0, 1, 0, 11, 12, 16, 31, 22], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 31, 22]]
1
180
5
#include "bits/stdc++.h" using namespace std; long long int GCD(long long int a, long long int b) { return (b % a == b) ? a : GCD(b % a, a); } long long int LCM(long long int a, long long int b) { return (a / GCD(a, b)) * b; } int main() { long long int a, b; while (cin >> a >> b) { cout << GCD(a, b) << " " << LCM(a, b) << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; long long int GCD(long long int a, long long int b) { return (b % a == 0) ? a : GCD(b % a, a); } long long int LCM(long long int a, long long int b) { return (a / GCD(a, b)) * b; } int main() { long long int a, b; while (cin >> a >> b) { cout << GCD(a, b) << " " << LCM(a, b) << endl; } return 0; }
[["-", 36, 36, 0, 30, 0, 135, 136, 5, 0, 62], ["-", 36, 36, 0, 30, 0, 135, 136, 5, 0, 6], ["+", 36, 36, 36, 36, 0, 30, 0, 135, 136, 137], ["-", 0, 37, 0, 41, 15, 23, 0, 16, 12, 22], ["+", 0, 37, 0, 41, 15, 23, 0, 16, 12, 13]]
1
124
6
#include <iostream> using namespace std; int main() { for (unsigned long a, b, x, r; cin >> a >> b; cout << x << ' ' << a << endl) { unsigned long at = a, bt = b; do { r = a % b; a = b; b = r; } while (r); x = at * bt / a; } return 0; }
#include <iostream> using namespace std; int main() { for (unsigned long a, b, x, r; cin >> a >> b; cout << a << ' ' << x << endl) { unsigned long at = a, bt = b; do { r = a % b; a = b; b = r; } while (r); x = at / a * bt; } return 0; }
[["-", 26, 16, 31, 16, 31, 16, 31, 16, 12, 22], ["+", 26, 16, 31, 16, 31, 16, 31, 16, 12, 22], ["-", 8, 9, 0, 7, 26, 16, 31, 16, 12, 22], ["+", 8, 9, 0, 7, 26, 16, 31, 16, 12, 22], ["-", 0, 1, 0, 11, 12, 16, 31, 16, 17, 48], ["-", 0, 1, 0, 11, 12, 16, 31, 16, 12, 22], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 48], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 12, 22]]
1
87
8
#include <iostream> #include <vector> using namespace std; int main() { int a, b; int temp; while (cin >> a >> b) { if (a < b) { temp = a; a = b; b = temp; } int a_ = a, b_ = b; while (a_ % b_ != 0) { temp = a_ % b_; a_ = b_; b_ = temp; } cout << b_ << " " << a * b / b_ << endl; } return 0; }
#include <iostream> #include <vector> using namespace std; int main() { int a, b; int temp; while (cin >> a >> b) { if (a < b) { temp = a; a = b; b = temp; } int a_ = a, b_ = b; while (a_ % b_ != 0) { temp = a_ % b_; a_ = b_; b_ = temp; } cout << b_ << " " << b / b_ * a << endl; } return 0; }
[["-", 0, 16, 31, 16, 12, 16, 31, 16, 31, 22], ["-", 0, 16, 31, 16, 12, 16, 31, 16, 17, 48], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 17, 48], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 12, 22]]
1
104
4
#include <iostream> using namespace std; int main() { int a, b; cin >> a >> b; int a2 = a; int b2 = b; while (true) { if (a > b) { a = a % b; } else { b = b % a; } if (a == 0 || b == 0) break; } cout << max(a, b) << " " << a2 / max(a, b) * b2 << endl; return 0; }
#include <iostream> using namespace std; int main() { int a, b; while (cin >> a >> b) { int a2 = a; int b2 = b; while (true) { if (a > b) { a = a % b; } else { b = b % a; } if (a == 0 || b == 0) break; } cout << max(a, b) << " " << a2 / max(a, b) * b2 << endl; } return 0; }
[["+", 0, 30, 0, 14, 8, 9, 0, 52, 0, 89], ["+", 0, 14, 8, 9, 0, 52, 15, 339, 0, 24], ["-", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35], ["+", 0, 14, 8, 9, 0, 52, 15, 339, 0, 25], ["+", 0, 14, 8, 9, 0, 52, 8, 9, 0, 45], ["+", 0, 14, 8, 9, 0, 52, 8, 9, 0, 46]]
1
103
6
#include <iostream> using namespace std; int GCD(int a, int b) { if (a % b == 0) return b; GCD(b, a % b); } int LCM(int a, int b) { int c = GCD(a, b); return a * b / c; } int main() { int a, b; while (cin >> a >> b) { cout << GCD(a, b) << ' ' << LCM(a, b) << '\n'; } return 0; }
#include <iostream> using namespace std; int GCD(int a, int b) { if (a % b == 0) return b; GCD(b, a % b); } int LCM(int a, int b) { int c = GCD(a, b); return a * (b / c); } int main() { int a, b; while (cin >> a >> b) { cout << GCD(a, b) << ' ' << LCM(a, b) << '\n'; } return 0; }
[["+", 8, 9, 0, 37, 0, 16, 12, 23, 0, 24], ["+", 8, 9, 0, 37, 0, 16, 12, 23, 0, 25]]
1
113
2
#include <iostream> int main() { int a, b; while (std::cin >> a >> b) { if (b > a) { int tmp = a; a = b; b = tmp; } int m = a; int n = b; while (n != 0) { int tmp = n; n = m % n; m = tmp; } std::cout << m << " " << (a * b / m) << std::endl; } return 0; }
#include <iostream> int main() { long a, b; while (std::cin >> a >> b) { if (b > a) { long tmp = a; a = b; b = tmp; } long m = a; long n = b; while (n != 0) { long tmp = n; n = m % n; m = tmp; } std::cout << m << " " << (a * b / m) << std::endl; } return 0; }
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 8, 9, 0, 57, 64, 9, 0, 43, 39, 40], ["+", 0, 57, 64, 9, 0, 43, 39, 86, 0, 96], ["-", 8, 9, 0, 52, 8, 9, 0, 43, 39, 40], ["+", 0, 52, 8, 9, 0, 43, 39, 86, 0, 96]]
1
104
10
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; typedef long long LL; typedef long double LD; typedef pair<int, int> P; typedef pair<int, P> P1; #define fr first #define sc second #define mp make_pair #define pb push_back #define rep(i, x) for (int i = 0; i < x; i++) #define rep1(i, x) for (int i = 1; i <= x; i++) #define rrep(i, x) for (int i = x - 1; i >= 0; i--) #define rrep1(i, x) for (int i = x; i > 0; i--) #define sor(v) sort(v.begin(), v.end()) #define rev(s) reverse(s.begin(), s.end()) #define lb(vec, a) lower_bound(vec.begin(), vec.end(), a) #define ub(vec, a) upper_bound(vec.begin(), vec.end(), a) #define uniq(vec) vec.erase(unique(vec.begin(), vec.end()), vec.end()) #define min_3(a, b, c) min(a, min(b, c)) #define max_3(a, b, c) max(a, max(b, c)) #define mp1(a, b, c) P1(a, P(b, c)) #define pque(a) priority_queue<a> #define rpque(a) priority_queue<a, vector<a>, greater<a>> const int INF = 1000000000; const int dre_4[4][2] = {{1, 0}, {0, 1}, {-1, 0}, {0, -1}}; const int dre_8[8][2] = {{1, 0}, {1, 1}, {0, 1}, {-1, 1}, {-1, 0}, {-1, -1}, {0, -1}, {1, -1}}; const int kaijou[10] = {1, 1, 2, 6, 24, 120, 720, 5040, 40320, 362880}; int gcd(int x, int y) { if (y == 0) return x; return gcd(y, x % y); } int main() { int a, b; scanf("%d%d", &a, &b); printf("%d %d\n", gcd(a, b), a / gcd(a, b) * b); }
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; typedef long long LL; typedef long double LD; typedef pair<int, int> P; typedef pair<int, P> P1; #define fr first #define sc second #define mp make_pair #define pb push_back #define rep(i, x) for (int i = 0; i < x; i++) #define rep1(i, x) for (int i = 1; i <= x; i++) #define rrep(i, x) for (int i = x - 1; i >= 0; i--) #define rrep1(i, x) for (int i = x; i > 0; i--) #define sor(v) sort(v.begin(), v.end()) #define rev(s) reverse(s.begin(), s.end()) #define lb(vec, a) lower_bound(vec.begin(), vec.end(), a) #define ub(vec, a) upper_bound(vec.begin(), vec.end(), a) #define uniq(vec) vec.erase(unique(vec.begin(), vec.end()), vec.end()) #define min_3(a, b, c) min(a, min(b, c)) #define max_3(a, b, c) max(a, max(b, c)) #define mp1(a, b, c) P1(a, P(b, c)) #define pque(a) priority_queue<a> #define rpque(a) priority_queue<a, vector<a>, greater<a>> const int INF = 1000000000; const int dre_4[4][2] = {{1, 0}, {0, 1}, {-1, 0}, {0, -1}}; const int dre_8[8][2] = {{1, 0}, {1, 1}, {0, 1}, {-1, 1}, {-1, 0}, {-1, -1}, {0, -1}, {1, -1}}; const int kaijou[10] = {1, 1, 2, 6, 24, 120, 720, 5040, 40320, 362880}; int gcd(int x, int y) { if (y == 0) return x; return gcd(y, x % y); } int main() { int a, b; while (~scanf("%d%d", &a, &b)) printf("%d %d\n", gcd(a, b), a / gcd(a, b) * b); }
[["+", 0, 30, 0, 14, 8, 9, 0, 52, 0, 89], ["+", 0, 14, 8, 9, 0, 52, 15, 339, 0, 24], ["+", 8, 9, 0, 52, 15, 339, 51, 91, 17, 92], ["-", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35], ["+", 0, 14, 8, 9, 0, 52, 15, 339, 0, 25]]
1
383
5
#include <stdio.h> int main() { long int a, b, a1, b1; long int r; while (scanf("%ld %ld", &a1, &b1) != EOF) { a = a1; b = b1; if (a < b) { r = b; b = a; a = r; } if (a < 0 || b < 0) { return 0; } r = a % b; while (r != 0) { a = b; b = r; r = a % b; } printf("%ld %ld", b, a1 / b * b1); } return 0; }
#include <stdio.h> int main() { long int a, b, a1, b1; long int r; while (scanf("%ld %ld", &a1, &b1) != EOF) { a = a1; b = b1; if (a < b) { r = b; b = a; a = r; } if (a <= 0 || b <= 0) { return 0; } r = a % b; while (r != 0) { a = b; b = r; r = a % b; } printf("%ld %ld\n", b, a1 / b * b1); } return 0; }
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 18], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 19], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 18], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 19], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44]]
1
130
5
#include <algorithm> #include <cstdio> int main() { int a, b; while (2 == scanf("%d%d", &a, &b)) printf("%d %d\n", std::__gcd(a, b), std::__gcd(a, b) * b); return 0; }
#include <algorithm> #include <cstdio> int main() { int a, b; while (2 == scanf("%d%d", &a, &b)) printf("%d %d\n", std::__gcd(a, b), a / std::__gcd(a, b) * b); return 0; }
[["+", 0, 2, 3, 4, 0, 16, 31, 16, 31, 22], ["+", 0, 2, 3, 4, 0, 16, 31, 16, 17, 85]]
1
63
2
#include <iostream> using namespace std; int gcd(int a, int b) { // a < b ユークリッドの互除法 if (a == 0) return b; return gcd(b % a, a); } // lcm = a*b/gcd int main() { int a, b; while (cin >> a >> b) { int g = gcd(a, b); cout << g << " " << a * b / g << endl; } return 0; }
#include <iostream> using namespace std; int gcd(int a, int b) { // a < b ユークリッドの互除法 if (a == 0) return b; return gcd(b % a, a); } // lcm = a*b/gcd int main() { int a, b; while (cin >> a >> b) { int g = gcd(a, b); cout << g << " " << a / g * b << endl; } return 0; }
[["-", 0, 16, 31, 16, 12, 16, 31, 16, 17, 48], ["-", 0, 16, 31, 16, 12, 16, 31, 16, 12, 22], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 17, 48], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 12, 22]]
1
88
4
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; #define all(c) (c).begin(), (c).end() #define rall(c) (c).rbegin(), (c).rend() #define loop(i, a, b) for (int i = (a); i < (int)(b); i++) #define rep(i, b) loop(i, 0, b) #define pb push_back #define mp make_pair int main() { typedef unsigned long long ull; ull a, b; cin >> a >> b; cout << __gcd(a, b) << " "; cout << a * b / __gcd(a, b) << endl; }
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; #define all(c) (c).begin(), (c).end() #define rall(c) (c).rbegin(), (c).rend() #define loop(i, a, b) for (int i = (a); i < (int)(b); i++) #define rep(i, b) loop(i, 0, b) #define pb push_back #define mp make_pair int main() { typedef unsigned long long ull; ull a, b; while (cin >> a >> b) { cout << __gcd(a, b) << " "; cout << a * b / __gcd(a, b) << endl; } }
[["+", 0, 30, 0, 14, 8, 9, 0, 52, 0, 89], ["+", 0, 14, 8, 9, 0, 52, 15, 339, 0, 24], ["-", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35], ["+", 0, 14, 8, 9, 0, 52, 15, 339, 0, 25], ["+", 0, 14, 8, 9, 0, 52, 8, 9, 0, 45], ["+", 0, 14, 8, 9, 0, 52, 8, 9, 0, 46]]
1
109
6
#include <iostream> using namespace std; int main() { int a, b, c, d, e, f, g, l; cin >> a >> b; c = a; d = b; e = a; f = b; while (1) { if (a > b) { a %= b; if (a == 0) { g = b; break; } } else if (a < b) { b %= a; if (b == 0) { g = a; break; } } } while (1) { if (c > d) d += f; else if (c < d) c += e; if (c == d) { l = c; break; } } cout << g << " " << l << endl; }
#include <iostream> using namespace std; int main() { int a, b, c, d, e, f, g, l; while (cin >> a >> b) { c = a; d = b; e = a; f = b; while (1) { if (a >= b) { a %= b; if (a == 0) { g = b; break; } } else if (a < b) { b %= a; if (b == 0) { g = a; break; } } } while (1) { if (c > d) d += f; else if (c < d) c += e; if (c == d) { l = c; break; } } cout << g << " " << l << endl; } }
[["+", 0, 30, 0, 14, 8, 9, 0, 52, 0, 89], ["+", 0, 14, 8, 9, 0, 52, 15, 339, 0, 24], ["-", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35], ["+", 0, 14, 8, 9, 0, 52, 15, 339, 0, 25], ["+", 0, 14, 8, 9, 0, 52, 8, 9, 0, 45], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 0, 14, 8, 9, 0, 52, 8, 9, 0, 46]]
1
163
8
#include "bits/stdc++.h" #define REP(i, n) for (int i = 0; i < n; i++) #define ALL(v) v.begin(), v.end() #define PB push_back #define MP make_pair using namespace std; int gcd(int a, int b) { if (b == 0) return a; return gcd(b, a % b); } int main() { int a, b; while (cin >> a >> b) { if (a < b) swap(a, b); int g = gcd(a, b); cout << g << a / g * b << endl; } }
#include "bits/stdc++.h" #define REP(i, n) for (int i = 0; i < n; i++) #define ALL(v) v.begin(), v.end() #define PB push_back #define MP make_pair using namespace std; int gcd(int a, int b) { if (b == 0) return a; return gcd(b, a % b); } int main() { int a, b; while (cin >> a >> b) { if (a <= b) swap(a, b); int g = gcd(a, b); cout << g << " " << a / g * b << endl; } }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 0, 1, 0, 16, 31, 16, 31, 16, 17, 151], ["+", 0, 16, 31, 16, 31, 16, 12, 5, 0, 62], ["+", 0, 16, 31, 16, 31, 16, 12, 5, 0, 6]]
1
114
6
#include <iostream> #include <stdio.h> using namespace std; int main() { int a, b, c, d, e, f; double x, y; while (cin >> a >> b >> c >> d >> e >> f) { x = (c * e - b * f) / (a * e - b * d); y = (c * d - a * f) / (b * d - a * e); if (x == 0) { x = 0.000; } if (y == 0) { y = 0.000; } printf("%.3f %.3f\n", x, y); } return 0; }
#include <iostream> #include <stdio.h> using namespace std; int main() { double a, b, c, d, e, f; double x, y; while (cin >> a >> b >> c >> d >> e >> f) { x = (c * e - b * f) / (a * e - b * d); y = (c * d - a * f) / (b * d - a * e); if (x == 0) { x = 0.000; } if (y == 0) { y = 0.000; } printf("%.3f %.3f\n", x, y); } return 0; }
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
133
2
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> #define all(c) (c).begin(), (c).end() #define rep(i, n) for (int i = 0; i < (n); i++) #define pb(e) push_back(e) #define mp(a, b) make_pair(a, b) #define fr first #define sc second typedef unsigned long long ull; typedef long long ll; const int INF = 100000000; int dx[4] = {1, 0, -1, 0}; int dy[4] = {0, 1, 0, -1}; using namespace std; typedef pair<int, int> P; int a, b, c, d, e, f; int main() { while (cin >> a >> b >> c >> d >> e >> f) { double y = (f * a - d * c) / (a * e - b * d); double x = (c - b * y) / a; /* if(x==0.0) x=0.0; if(y==0.0) y=0.0; */ printf("%.3lf %.3lf\n", x, y); } return 0; }
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> #define all(c) (c).begin(), (c).end() #define rep(i, n) for (int i = 0; i < (n); i++) #define pb(e) push_back(e) #define mp(a, b) make_pair(a, b) #define fr first #define sc second typedef unsigned long long ull; typedef long long ll; const int INF = 100000000; int dx[4] = {1, 0, -1, 0}; int dy[4] = {0, 1, 0, -1}; using namespace std; typedef pair<int, int> P; double a, b, c, d, e, f; int main() { while (cin >> a >> b >> c >> d >> e >> f) { double y = (f * a - d * c) / (a * e - b * d); double x = (c - b * y) / a; /* if(x==0.0) x=0.0; if(y==0.0) y=0.0; */ printf("%.3lf %.3lf\n", x, y); } return 0; }
[["-", 36, 36, 36, 36, 0, 30, 0, 43, 39, 40], ["+", 36, 36, 36, 36, 0, 30, 0, 43, 39, 40]]
1
219
2
#include <cmath> #include <iostream> #include <stdio.h> #define EPS 0.001 using namespace std; main() { int a, b, c, d, e, f; double x, y; while (cin >> a >> b >> c >> d >> e >> f) { x = 1.0 * (c * e - b * f) / (a * e - b * d) + EPS; y = 1.0 * (c * d - a * f) / (b * d - a * e) + EPS; printf("%.3lf %.3lf\n", x, y); } }
#include <cmath> #include <iostream> #include <stdio.h> #define EPS 0.00001 using namespace std; main() { int a, b, c, d, e, f; double x, y; while (cin >> a >> b >> c >> d >> e >> f) { x = 1.0 * (c * e - b * f) / (a * e - b * d) + EPS; y = 1.0 * (c * d - a * f) / (b * d - a * e) + EPS; printf("%.3lf %.3lf\n", x, y); } }
[["-", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59], ["+", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59]]
1
118
2
#include <cmath> #include <cstdio> #include <iostream> using namespace std; int main() { double a, b, c, d, e, f; double x, y; while (cin >> a >> b >> c >> d >> e >> f) { x = (c * e - b * f) / (a * e - b * d); y = (c * d - a * f) / (b * d - a * e); if (abs(x) < 0.001) x = 0; if (abs(y) < 0.001) y = 0; printf("%.3f %.3f", x, y); } return 0; }
#include <cmath> #include <cstdio> #include <iostream> using namespace std; int main() { double a, b, c, d, e, f; double x, y; while (cin >> a >> b >> c >> d >> e >> f) { x = (c * e - b * f) / (a * e - b * d); y = (c * d - a * f) / (b * d - a * e); if (abs(x) < 0.001) x = 0; if (abs(y) < 0.001) y = 0; printf("%.3f %.3f\n", x, y); } return 0; }
[["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44]]
1
136
1
/* -*- coding:utf-8 -*- */ #include <cmath> #include <cstdlib> #include <iomanip> #include <iostream> using namespace std; int main(void) { double a, b, c, d, e, f; while (cin >> a >> b >> c >> d >> e >> f, !cin.eof()) { cout << "\n"; double x, y; x = (e * c - b * f) / (a * e - b * d); y = (-c * d + a * f) / (a * e - b * d); cout << fixed << setprecision(3) << showpoint << ((fabs(x) < 1e-4) ? 0 : x) << ' ' << ((fabs(y) < 1e-4) ? 0 : y) << endl; } return 0; }
/* -*- coding:utf-8 -*- */ #include <cmath> #include <cstdlib> #include <iomanip> #include <iostream> using namespace std; int main(void) { double a, b, c, d, e, f; while (cin >> a >> b >> c >> d >> e >> f, !cin.eof()) { double x, y; x = (e * c - b * f) / (a * e - b * d); y = (-c * d + a * f) / (a * e - b * d); cout << fixed << setprecision(3) << showpoint << ((fabs(x) < 1e-4) ? 0 : x) << ' ' << ((fabs(y) < 1e-4) ? 0 : y) << endl; } return 0; }
[["-", 0, 52, 8, 9, 0, 1, 0, 16, 31, 22], ["-", 0, 52, 8, 9, 0, 1, 0, 16, 17, 151], ["-", 8, 9, 0, 1, 0, 16, 12, 5, 0, 62], ["-", 8, 9, 0, 1, 0, 16, 12, 5, 0, 44], ["-", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35]]
1
164
6
#include <iostream> #include <stdio.h> using namespace std; void solve() { int a; while (cin >> a) { int b, c, d, e, f; cin >> b >> c >> d >> e >> f; double x = (c * e - b * f) / (double)(a * e - b * d); double y = (c * d - a * f) / (double)(b * d - a * e); if (x == -0) { x = 0; } if (y == -0) { y = 0; } printf("%.6f %.6f\n", x, y); } } int main() { solve(); return (0); }
#include <iostream> #include <stdio.h> using namespace std; void solve() { int a; while (cin >> a) { int b, c, d, e, f; cin >> b >> c >> d >> e >> f; double x = (c * e - b * f) / (double)(a * e - b * d); double y = (c * d - a * f) / (double)(b * d - a * e); if (x == -0) { x = 0; } if (y == -0) { y = 0; } printf("%.3f %.3f\n", x, y); } } int main() { solve(); return (0); }
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
1
151
2
#include <cstdio> #include <iomanip> #include <iostream> int main() { int a, b, c, d, e, f; while (std::cin >> a >> b >> c >> d >> e >> f) { double x, y; y = (c * d - a * f) / (b * d - a * e); x = (c - b * y) / a; if (x == 0) x = 0.000; if (y == 0) y = 0.000; printf("%.3f %.3f\n", x, y); } return 0; }
#include <cstdio> #include <iomanip> #include <iostream> int main() { double a, b, c, d, e, f; while (std::cin >> a >> b >> c >> d >> e >> f) { double x, y; y = (c * d - a * f) / (b * d - a * e); x = (c - b * y) / a; if (x == 0) x = 0.000; if (y == 0) y = 0.000; printf("%.3f %.3f\n", x, y); } return 0; }
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
119
2
#include <cstdio> #include <iostream> using namespace std; void Solve(double a, double b, double c, double d, double e, double f) { double x, y; y = (a * f - d * c) / (a * e - d * b); x = (c - b * y) / a; if (x == 0) x = 0.000; if (y == 0) y = 0.000; printf("%4.3f %4.3f\n", x, y); } int main() { double a, b, c, d, e, f; cin >> a >> b >> c >> d >> e >> f; Solve(a, b, c, d, e, f); return 0; }
#include <cstdio> #include <iostream> using namespace std; void Solve(double a, double b, double c, double d, double e, double f) { double x, y; y = (a * f - d * c) / (a * e - d * b); x = (c - b * y) / a; if (x == 0) x = 0.000; if (y == 0) y = 0.000; printf("%4.3f %4.3f\n", x, y); } int main() { double a, b, c, d, e, f; while (cin >> a >> b >> c >> d >> e >> f) { Solve(a, b, c, d, e, f); } return 0; }
[["+", 0, 30, 0, 14, 8, 9, 0, 52, 0, 89], ["+", 0, 14, 8, 9, 0, 52, 15, 339, 0, 24], ["-", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35], ["+", 0, 14, 8, 9, 0, 52, 15, 339, 0, 25], ["+", 0, 14, 8, 9, 0, 52, 8, 9, 0, 45], ["+", 0, 14, 8, 9, 0, 52, 8, 9, 0, 46]]
1
153
6
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> using namespace std; double sisyagonyu(double num, int keta) { if (keta < 1) return num; int i = num * pow(10, keta); int sg = num * pow(10, keta + 1) - i * 10; if (sg >= 5) i++; else if (sg <= -5) i--; return i / pow(10.0, keta); }; int main() { double a, b, c, d, e, f; double x, y; while (cin) { cin >> a >> b >> c >> d >> e >> f; x = (c * e - b * f) / (a * e - b * d); y = (a * f - c * d) / (a * e - b * d); cout << setiosflags(ios::fixed) << setprecision(3); cout << sisyagonyu(x, 3) << ' ' << sisyagonyu(y, 3) << endl; } return 0; }
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> using namespace std; double sisyagonyu(double num, int keta) { if (keta < 1) return num; int i = num * pow(10, keta); int sg = num * pow(10, keta + 1) - i * 10; if (sg >= 5) i++; else if (sg <= -5) i--; return i / pow(10.0, keta); }; int main() { double a, b, c, d, e, f; double x, y; while (cin >> a >> b >> c >> d >> e >> f) { x = (c * e - b * f) / (a * e - b * d); y = (a * f - c * d) / (a * e - b * d); cout << setiosflags(ios::fixed) << setprecision(3); cout << sisyagonyu(x, 3) << ' ' << sisyagonyu(y, 3) << endl; } return 0; }
[["-", 0, 14, 8, 9, 0, 52, 15, 339, 0, 25], ["-", 0, 14, 8, 9, 0, 52, 8, 9, 0, 45], ["-", 31, 16, 31, 16, 31, 16, 31, 16, 31, 22], ["-", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35], ["+", 0, 14, 8, 9, 0, 52, 15, 339, 0, 25], ["+", 0, 14, 8, 9, 0, 52, 8, 9, 0, 45]]
1
219
6
#include <iostream> #include <stdio.h> int main() { double a, b, c, d, e, f; double x, y; std::cin >> a >> b >> c >> d >> e >> f; y = (a * f - d * c) / (a * e - b * d); x = (c - b * y) / a; printf("%.3f %.3f\n", x, y); return 0; }
#include <iostream> #include <stdio.h> int main() { double a, b, c, d, e, f; double x, y; while (std::cin >> a >> b >> c >> d >> e >> f) { y = (a * f - d * c) / (a * e - b * d); x = (c - b * y) / a; printf("%.3f %.3f\n", x, y); } return 0; }
[["+", 0, 30, 0, 14, 8, 9, 0, 52, 0, 89], ["+", 0, 14, 8, 9, 0, 52, 15, 339, 0, 24], ["-", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35], ["+", 0, 14, 8, 9, 0, 52, 15, 339, 0, 25], ["+", 0, 14, 8, 9, 0, 52, 8, 9, 0, 45], ["+", 0, 14, 8, 9, 0, 52, 8, 9, 0, 46]]
1
93
6
#include <iomanip> #include <iostream> #include <vector> using namespace std; int main() { int a, b, c, d, e, f; vector<double> x, y; while (cin >> a) { double tmpY; cin >> b >> c >> d >> e >> f; if (a * e != b * d) { y.push_back((c * d - a * f) / (b * d - a * e)); tmpY = (c * d - a * f) / (b * d - a * e); } else { continue; } if (a != 0) { x.push_back((c - b * tmpY) / a); } else if (d != 0) { x.push_back((f - e * tmpY) / d); } else { continue; } } for (int i = 0; i < x.size(); i++) { cout << fixed << setprecision(3) << x[i] << " " << y[i] << endl; } }
#include <iomanip> #include <iostream> #include <vector> using namespace std; int main() { double a, b, c, d, e, f; vector<double> x, y; while (cin >> a) { double tmpY; cin >> b >> c >> d >> e >> f; if (a * e != b * d) { y.push_back((c * d - a * f) / (b * d - a * e)); tmpY = (c * d - a * f) / (b * d - a * e); } else { continue; } if (a != 0) { x.push_back((c - b * tmpY) / a); } else if (d != 0) { x.push_back((f - e * tmpY) / d); } else { continue; } } for (int i = 0; i < x.size(); i++) { cout << fixed << setprecision(3) << x[i] << " " << y[i] << endl; } }
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
221
2
#include <iostream> #include <stdio.h> using namespace std; int det(int a00, int a01, int a10, int a11) { return a00 * a11 - a01 * a10; } int main() { int a, b, c, d, e, f; while (cin >> a >> b >> c >> d >> e >> f) { int t = det(a, b, d, e); double x = (double)det(c, b, f, e) / t; double y = (double)det(a, c, d, f) / t; if (x == 0) x = 0; if (y == 0) y = 0; printf("%.3f %.3f", x, y); } return 0; }
#include <iostream> #include <stdio.h> using namespace std; int det(int a00, int a01, int a10, int a11) { return a00 * a11 - a01 * a10; } int main() { int a, b, c, d, e, f; while (cin >> a >> b >> c >> d >> e >> f) { int t = det(a, b, d, e); double x = (double)det(c, b, f, e) / t; double y = (double)det(a, c, d, f) / t; if (x == 0) x = 0; if (y == 0) y = 0; printf("%.3f %.3f\n", x, y); } return 0; }
[["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44]]
1
157
1
while line = gets # a,b,c,d,e,f = [2,-1,-3,-9,9,27].map(&:to_f) a, b, c, d, e, f = line.split(' ').map(&:to_f) y = a.zero? ? c / b : (f - (d * c / a)) / (e - (b * d / a)) x = d.zero? ? c - (b * y) / a : (f - e * y) / d x = 0 if x == 0.0 y = 0 if y == 0.0 puts format('%.3f %.3f', x, y) end
while line = gets # a,b,c,d,e,f = [2,-1,-3,-9,9,27].map(&:to_f) a, b, c, d, e, f = line.split(' ').map(&:to_f) y = a.zero? ? c / b : (f - (d * c / a)) / (e - (b * d / a)) x = d.zero? ? (c - (b * y)) / a : (f - e * y) / d x = 0 if x.abs == 0.0 y = 0 if y.abs == 0.0 puts format('%.3f %.3f', x, y) end
[["+", 0, 662, 12, 754, 64, 738, 31, 739, 0, 24], ["+", 0, 662, 12, 754, 64, 738, 31, 739, 0, 25], ["+", 8, 170, 0, 751, 15, 738, 31, 652, 17, 131], ["+", 8, 170, 0, 751, 15, 738, 31, 652, 735, 22]]
4
115
6
$stdin.each do |s| a, b, c, d, e, f = s.split(' ').map!(&:to_i) z1 = b * d - e * a z2 = c * d - f * a y = z2 / z1 x = (-(b * y) + c) / a printf("%.3f %.3f\n", x, y) end
$stdin.each do |s| a, b, c, d, e, f = s.split(' ').map!(&:to_f) z1 = b * d - e * a z2 = c * d - f * a y = z2 / z1 x = (-(b * y) + c) / a printf("%.3f %.3f\n", x, y) end
[["-", 0, 662, 12, 652, 3, 4, 0, 752, 0, 753], ["+", 0, 662, 12, 652, 3, 4, 0, 752, 0, 753]]
4
82
2
args = [] while line = gets a, b, c, d, e, f = line.split.map(&:to_i) y = (a * f - d * c) / (a * e - d * b) x = (c - b * y) / a puts "#{format('%.3f', x)} #{format('%.3f', y)}" end
args = [] while line = gets a, b, c, d, e, f = line.split.map(&:to_f) y = (a * f - d * c) / (a * e - d * b) x = (c - b * y) / a puts "#{format('%.3f', x)} #{format('%.3f', y)}" end
[["-", 0, 662, 12, 652, 3, 4, 0, 752, 0, 753], ["+", 0, 662, 12, 652, 3, 4, 0, 752, 0, 753]]
4
86
2
# a1x + b1y = c1 # a2x + b2y = c2 require 'English' def solve(a1, b1, c1, a2, b2, c2) x = (c1 * b2 - c2 * b1) / (a1 * b2 - a2 * b1) x = 0.0 if x == -0.0 y = (a1 * c2 - a2 * c1) / (a1 * b2 - a2 * b1) y = 0.0 if y == -0.0 [x, y] end $DEFAULT_INPUT.each do |l| a, b, c, d, e, f = l.split.map(&:to_f) x, y = solve(a, b, c, d, e, f) printf("%.4f %.4f\n", x, y) end
# a1x + b1y = c1 # a2x + b2y = c2 require 'English' def solve(a1, b1, c1, a2, b2, c2) x = (c1 * b2 - c2 * b1) / (a1 * b2 - a2 * b1) x = 0.0 if x == -0.0 y = (a1 * c2 - a2 * c1) / (a1 * b2 - a2 * b1) y = 0.0 if y == -0.0 [x, y] end $DEFAULT_INPUT.each do |l| a, b, c, d, e, f = l.split.map(&:to_f) x, y = solve(a, b, c, d, e, f) printf("%.3f %.3f\n", x, y) end
[["-", 8, 736, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 8, 736, 0, 652, 3, 4, 0, 557, 0, 6]]
4
143
2
require 'English' require 'matrix' while gets a, b, c, d, e, f = $LAST_READ_LINE.split(&:to_f) v = Matrix[[a, b], [d, e]].inverse * Vector[c, f] printf("%.3f %.3f\n", *v) end
require 'English' require 'matrix' while gets a, b, c, d, e, f = $LAST_READ_LINE.split.map(&:to_f) v = Matrix[[a, b], [d, e]].inverse * Vector[c, f] printf("%.3f %.3f\n", *v) end
[["+", 0, 89, 8, 170, 0, 662, 12, 652, 17, 131], ["+", 0, 89, 8, 170, 0, 662, 12, 652, 735, 22]]
4
65
2
$stdout.sync = true num = [] while data = $stdin.gets num = data.split.map!(&:to_i) y = (num[2] * num[3] - num[0] * num[5]) / (num[1] * num[3] - num[0] * num[4]) x = (num[2] - num[1] * y) / num[0] puts format("%.3f %.3f\n", x, y) end
$stdout.sync = true num = [] while data = $stdin.gets num = data.split.map!(&:to_f) y = (num[2] * num[3] - num[0] * num[5]) / (num[1] * num[3] - num[0] * num[4]) x = (num[2] - num[1] * y) / num[0] puts format('%.3f %.3f', x, y) end
[["-", 0, 662, 12, 652, 3, 4, 0, 752, 0, 753], ["+", 0, 662, 12, 652, 3, 4, 0, 752, 0, 753], ["-", 3, 4, 0, 652, 3, 4, 0, 557, 0, 62], ["+", 3, 4, 0, 652, 3, 4, 0, 557, 0, 62], ["-", 3, 4, 0, 652, 3, 4, 0, 557, 0, 44]]
4
104
7
$stdin.each_line do |line| a, b, c, d, e, f = line.split.map(&:to_f) x = (b * f - a * c) / (b * d - a * e) y = (c - a * x) / b puts format('%.03f %.03f', x + 0.0, y + 0.0) end
$stdin.each_line do |line| a, b, c, d, e, f = line.split.map(&:to_f) x = (b * f - c * e) / (b * d - a * e) y = (c - a * x) / b puts format('%.3f %.3f', x + 0.0, y + 0.0) # puts "#{sprintf("%.3f",x)} #{sprintf("%.3f",y)}" end
[["-", 12, 738, 31, 739, 0, 738, 12, 738, 31, 22], ["-", 12, 738, 31, 739, 0, 738, 12, 738, 17, 48], ["+", 12, 738, 31, 739, 0, 738, 12, 738, 17, 48], ["+", 12, 738, 31, 739, 0, 738, 12, 738, 12, 22], ["-", 3, 4, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 3, 4, 0, 652, 3, 4, 0, 557, 0, 6]]
4
76
6
$stdin.each_line do |line| a, b, c, d, e, f = line.split.map(&:to_f) x = (b * f - a * c) / (b * d - a * e) y = (c - a * x) / b puts format('%.03f %.03f', x + 0.0, y + 0.0) end
$stdin.each_line do |line| a, b, c, d, e, f = line.split.map(&:to_f) x = (b * f - c * e) / (b * d - a * e) y = (c - a * x) / b puts format('%.3f %.3f', x + 0.0, y + 0.0) end
[["-", 12, 738, 31, 739, 0, 738, 12, 738, 31, 22], ["-", 12, 738, 31, 739, 0, 738, 12, 738, 17, 48], ["+", 12, 738, 31, 739, 0, 738, 12, 738, 17, 48], ["+", 12, 738, 31, 739, 0, 738, 12, 738, 12, 22], ["-", 3, 4, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 3, 4, 0, 652, 3, 4, 0, 557, 0, 6]]
4
76
6
while line = gets a, b, c, d, e, f = line.split.map(&:to_f) det = (a * e - b * d) / 1000.0 printf "%.3f %.3f\n", ((c * e - b * f) / det).round / 1000.0, ((a * f - c * d) / det).round / 1000 end
while line = gets a, b, c, d, e, f = line.split.map(&:to_f) det = (a * e - b * d) / 1000.0 printf "%.3f %.3f\n", ((c * e - b * f) / det).round / 1000.0, ((a * f - c * d) / det).round / 1000.0 end
[["-", 8, 170, 0, 652, 3, 4, 0, 738, 12, 612], ["+", 8, 170, 0, 652, 3, 4, 0, 738, 12, 531]]
4
80
2
require 'English' while $stdin.gets a, b, c, d, e, f = $LAST_READ_LINE.split(' ').map(&:to_i) // ratio = d.to_i / a aa = a * ratio bb = b * ratio cc = c * ratio coe_y = bb - e right = cc - f y = right / coe_y // coe_x = a right = c - b * y x = right / coe_x puts format('%.3f %.3f', x, y) end
require 'English' while $stdin.gets a, b, c, d, e, f = $LAST_READ_LINE.split(' ').map(&:to_i) // ratio = d.to_f / a aa = a * ratio bb = b * ratio cc = c * ratio coe_y = bb - e right = cc - f y = right / coe_y // coe_x = a right = c - b * y x = right / coe_x puts format('%.3f %.3f', x, y) end
[["-", 8, 170, 0, 662, 12, 738, 31, 652, 735, 22], ["+", 8, 170, 0, 662, 12, 738, 31, 652, 735, 22]]
4
102
2
def getX(a, b, c, d, e, f) denominator = a * e - b * d numerator = c * e - b * f x = numerator / denominator x = 0.0 if x == -0.0 x end def getY(a, b, c, d, e, f) denominator = b * d - a * e numerator = c * d - a * f y = numerator / denominator y = 0.0 if y == -0.0 y end f = Array.new(6) while input = gets value = input.split(/\s* \s*/) (0...value.size).each do |i| f[i] = value[i].to_f end puts format('%#.04g %#.04g', getX(f[0], f[1], f[2], f[3], f[4], f[5]), getY(f[0], f[1], f[2], f[3], f[4], f[5])) end
def getX(a, b, c, d, e, f) denominator = a * e - b * d numerator = c * e - b * f x = numerator / denominator x = 0.0 if x == -0.0 x end def getY(a, b, c, d, e, f) denominator = b * d - a * e numerator = c * d - a * f y = numerator / denominator y = 0.0 if y == -0.0 y end f = Array.new(6) while input = gets value = input.split(/\s* \s*/) (0...value.size).each do |i| f[i] = value[i].to_f end puts format('%.3f %.3f', getX(f[0], f[1], f[2], f[3], f[4], f[5]), getY(f[0], f[1], f[2], f[3], f[4], f[5])) end
[["-", 3, 4, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 3, 4, 0, 652, 3, 4, 0, 557, 0, 6]]
4
220
2
require 'matrix' def solve(line) a = Matrix[[line[0].to_f, line[1].to_f], [line[3].to_f, line[4].to_f]] p a b = Vector[line[2].to_f, line[5].to_f] p b s = a.inv * b s.to_a end inputs = [] while (line = gets) != nil inputs.push(line.split) end inputs.each do |i| s = solve(i) puts printf('%#0.3f %#0.3f', s[0], s[1]) end
require 'matrix' def solve(line) a = Matrix[[line[0].to_f, line[1].to_f], [line[3].to_f, line[4].to_f]] b = Vector[line[2].to_f, line[5].to_f] s = a.inv * b s.to_a end inputs = [] while (line = gets) != nil inputs.push(line.split) end inputs.each do |i| s = solve(i) puts printf('%#0.3f %#0.3f', s[0], s[1]) end
[["-", 0, 493, 0, 735, 8, 736, 0, 652, 735, 22], ["-", 0, 735, 8, 736, 0, 652, 3, 4, 0, 22]]
4
130
4
while tmp = gets a, b, c, d, e, f = tmp.split.map(&:to_i) printf("%.3f %.3f\n", 1e-9 + 1.*(c * e - b * f) / (a * e - b * d), 1e-9 + 1.*(a * f - c * d) / (a * e - b * d)) end
while tmp = gets a, b, c, d, e, f = tmp.split.map(&:to_f) puts format('%.3f %.3f', 1e-9 + 1.*(c * e - b * f) / (a * e - b * d), 1e-9 + 1.*(a * f - c * d) / (a * e - b * d)) end
[["-", 0, 662, 12, 652, 3, 4, 0, 752, 0, 753], ["+", 0, 662, 12, 652, 3, 4, 0, 752, 0, 753], ["-", 0, 493, 0, 89, 8, 170, 0, 652, 735, 22], ["+", 0, 493, 0, 89, 8, 170, 0, 652, 735, 22], ["+", 8, 170, 0, 652, 3, 4, 0, 652, 735, 22], ["-", 8, 170, 0, 652, 3, 4, 0, 557, 0, 62], ["+", 3, 4, 0, 652, 3, 4, 0, 557, 0, 62], ["-", 8, 170, 0, 652, 3, 4, 0, 557, 0, 44]]
4
83
10
def f(line) a, b, c, d, e, f = line.split(' ').map(&:to_i) y = (a * f - d * c) / (a * e - d * b) x = (c - b * y) / a format('%.3f %.3f', x, y) end while line = gets puts f(line) end
def f(line) a, b, c, d, e, f = line.split(' ').map(&:to_f) y = (a * f - d * c) / (a * e - d * b) x = (c - b * y) / a format('%.3f %.3f', x, y) end while line = gets puts f(line) end
[["-", 0, 662, 12, 652, 3, 4, 0, 752, 0, 753], ["+", 0, 662, 12, 652, 3, 4, 0, 752, 0, 753]]
4
84
2
$stdin.each do |value| a, b, c, d, e, f = value.split.map(&:to_i) y = ((e * c - b * f) * 1.0 / (a * e - b * d) * 1000).round / 1000.0 x = ((a * f - d * c) * 1.0 / (a * e - b * d) * 1000).round / 1000.0 puts format('%.3f %.3f', x.to_f, y.to_f) end
$stdin.each do |value| a, b, c, d, e, f = value.split.map(&:to_i) x = ((e * c - b * f) * 1.0 / (a * e - b * d) * 1000).round / 1000.0 y = ((a * f - d * c) * 1.0 / (a * e - b * d) * 1000).round / 1000.0 puts format('%.3f %.3f', x.to_f, y.to_f) end
[["-", 0, 652, 196, 737, 8, 736, 0, 662, 31, 22], ["+", 0, 652, 196, 737, 8, 736, 0, 662, 31, 22]]
4
106
4
while set = gets break if set.nil? || (set == "\n") || (set == "\n\r") a, b, c, d, e, f = set.split.map(&:to_f) y = (d * c - a * f) / (d * b - a * e) x = (c - b * y) / a printf('%.3f %.3f', x, y) end
while set = gets break if set.nil? || (set == "\n") || (set == "\n\r") a, b, c, d, e, f = set.split.map(&:to_f) y = (d * c - a * f) / (d * b - a * e) x = (c - b * y) / a printf("%.3f %.3f\n", x, y) end
[["-", 8, 170, 0, 652, 3, 4, 0, 557, 0, 62], ["+", 8, 170, 0, 652, 3, 4, 0, 557, 0, 62], ["+", 8, 170, 0, 652, 3, 4, 0, 557, 0, 44]]
4
90
5
#include <algorithm> #include <functional> #include <iomanip> #include <iostream> #include <string> #include <utility> #include <vector> typedef unsigned long ul; using namespace std; int main() { int len; string str; cin >> str; len = str.length(); for (int i = len - 1; i >= 0; i--) { cout << str.at(i) << endl; } }
#include <algorithm> #include <functional> #include <iomanip> #include <iostream> #include <string> #include <utility> #include <vector> typedef unsigned long ul; using namespace std; int main() { int len; string str; cin >> str; len = str.length(); for (int i = len - 1; i >= 0; i--) { cout << str.at(i); } cout << endl; }
[["+", 8, 9, 0, 7, 8, 9, 0, 1, 0, 35], ["+", 0, 14, 8, 9, 0, 7, 8, 9, 0, 46], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["-", 0, 14, 8, 9, 0, 7, 8, 9, 0, 46]]
1
76
4
#include <climits> #include <cmath> #include <cstdio> #include <iostream> #include <utility> using namespace std; int main() { int i, j; char str[20] = {}; for (i = 0; cin >> str[i]; i++) { } for (j = i - 1; j >= 0; j--) { cout << str[j] << endl; } return 0; }
#include <climits> #include <cmath> #include <cstdio> #include <iostream> #include <utility> using namespace std; int main() { int i, j; char str[20] = {}; for (i = 0; cin >> str[i]; i++) { } for (j = i - 1; j >= 0; j--) { cout << str[j]; } cout << endl; return 0; }
[["+", 8, 9, 0, 7, 8, 9, 0, 1, 0, 35], ["+", 0, 14, 8, 9, 0, 7, 8, 9, 0, 46], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["-", 0, 14, 8, 9, 0, 7, 8, 9, 0, 46]]
1
81
4
#include <iostream> #include <string> using namespace std; int main() { char a; string str; cin >> str; for (int i = 0; i != str.size() - 1 - i; i++) { a = str[i]; str[i] = str[str.size() - 1 - i]; str[str.size() - 1 - i] = a; } cout << str << endl; }
#include <iostream> #include <string> using namespace std; int main() { char a; string str; cin >> str; for (int i = 0; i < str.size() - 1 - i; i++) { a = str[i]; str[i] = str[str.size() - 1 - i]; str[str.size() - 1 - i] = a; } cout << str << endl; }
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 79], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18]]
1
94
2
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; #define REP(i, n) for (int(i) = 0; (i) < (int)(n); (i)++) #define REMOVE(Itr, n) \ (Itr).erase(remove((Itr).begin(), (Itr).end(), n), (Itr).end()) #define PB_VEC(Itr1, Itr2) \ (Itr1).insert((Itr1).end(), (Itr2).begin(), (Itr2).end()) #define UNIQUE(Itr) \ sort((Itr).begin(), (Itr).end()); \ (Itr).erase(unique((Itr).begin(), (Itr).end()), (Itr).end()) #define BOUND(Itr, val) lower_bound((Itr).begin(), (Itr).end(), (val)) typedef long long ll; int main() { string s; reverse(s.begin(), s.end()); cout << s << endl; return 0; }
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; #define REP(i, n) for (int(i) = 0; (i) < (int)(n); (i)++) #define REMOVE(Itr, n) \ (Itr).erase(remove((Itr).begin(), (Itr).end(), n), (Itr).end()) #define PB_VEC(Itr1, Itr2) \ (Itr1).insert((Itr1).end(), (Itr2).begin(), (Itr2).end()) #define UNIQUE(Itr) \ sort((Itr).begin(), (Itr).end()); \ (Itr).erase(unique((Itr).begin(), (Itr).end()), (Itr).end()) #define BOUND(Itr, val) lower_bound((Itr).begin(), (Itr).end(), (val)) typedef long long ll; int main() { string s; cin >> s; reverse(s.begin(), s.end()); cout << s << endl; return 0; }
[["+", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
105
4
#include <iostream> using namespace std; int main() { string str; cin >> str; for (int i = str.length() - 1; i >= 0; i--) cout << str[i]; cout << NULL; return 0; }
#include <iostream> using namespace std; int main() { string str; cin >> str; for (int i = str.length() - 1; i >= 0; i--) cout << str[i]; cout << endl; return 0; }
[["-", 8, 9, 0, 1, 0, 16, 12, 144, 0, 145], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22]]
1
53
2
#include <stdio.h> int main() { int n = 0; char a[1000]; for (int i = 0; i < 1000; i++) a[i] = '\0'; scanf("%s", a); while (a[n] != '\0') n++; for (int i = n - 1; i >= 0; i++) printf("%c", a[i]); printf("\n"); }
#include <stdio.h> int main() { int n = 0; char a[1000]; for (int i = 0; i < 1000; i++) a[i] = '\0'; scanf("%s", a); while (a[n] != '\0') n++; for (int i = n - 1; i >= 0; i--) printf("%c", a[i]); printf("\n"); }
[["-", 0, 14, 8, 9, 0, 7, 26, 27, 17, 29], ["+", 0, 14, 8, 9, 0, 7, 26, 27, 17, 68]]
1
100
2
#include <bits/stdc++.h> using namespace std; int main() { string s; reverse(s.begin(), s.end()); cout << s << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; reverse(s.begin(), s.end()); cout << s << endl; return 0; }
[["+", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
39
4
#include <iostream> #include <string.h> using namespace std; int main() { char bun[25] = {}; int len; cin >> bun; len = strlen(bun); for (int i = len - 1; i > 0; i--) { cout << bun[i]; } cout << endl; return 0; }
#include <iostream> #include <string.h> using namespace std; int main() { char bun[25] = {}; int len; cin >> bun; len = strlen(bun); for (int i = len - 1; i >= 0; i--) { cout << bun[i]; } cout << endl; return 0; }
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 47], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 20]]
1
69
2
#include <stdio.h> int main(void) { int i = 0, j; char str, ch[21]; while (scanf("%c", &str) != EOF) { ch[i] = str; // printf("%c",ch[i]); i++; } for (j = i - 3; j >= 0; j--) { printf("%c", ch[j]); } printf("\n"); return 0; }
#include <stdio.h> int main(void) { int i = 0, j; char str, ch[21]; while (scanf("%c", &str) != EOF) { ch[i] = str; // printf("%c",ch[i]); i++; } for (j = i - 2; j >= 0; j--) { printf("%c", ch[j]); } printf("\n"); return 0; }
[["-", 8, 9, 0, 7, 10, 11, 12, 16, 12, 13], ["+", 8, 9, 0, 7, 10, 11, 12, 16, 12, 13]]
0
90
2
#include <stdio.h> int main() { char str[21], henkan[21]; int i = 0, j = 0; scanf("%s", str); while (str[i]) { i++; } henkan[i] = '\0'; i--; while (henkan[j]) { henkan[j] = str[i]; i--; j++; } printf("%s\n", henkan); return 0; }
#include <stdio.h> /*gets(),puts()‚¾‚ƃRƒ“ƒpƒCƒ‹ƒGƒ‰[‚ƃWƒƒƒbƒW‚³‚ꂽH*/ int main() { char str[21], henkan [21]; /*20•¶ŽšˆÈ“à‚ŁAÅŒã‚É‚Í'\0'‚ªŠÜ‚Ü‚ê‚é‚Ì‚Å*/ int i = 0, j = 0; scanf("%s", str); while (str[i]) { /*•¶Žš—ñ‚Ì’·‚³‚Í‚¢‚­‚ç‚©‚ȁH*/ i++; } henkan[i] = '\0'; /*•¶Žš—ñ‚Ì’·‚³‚ðŽw’è*/ i--; /*ÅŒã‚Ì•¶Žš‚Ɉړ®‚·‚é*/ while (str[j]) { henkan[i] = str[j]; /*•ÏŠ·*/ i--; j++; } printf("%s\n", henkan); return 0; }
[["-", 8, 9, 0, 52, 15, 23, 0, 69, 28, 22], ["+", 8, 9, 0, 52, 15, 23, 0, 69, 28, 22], ["-", 8, 9, 0, 1, 0, 11, 31, 69, 71, 22], ["+", 8, 9, 0, 1, 0, 11, 31, 69, 71, 22], ["-", 8, 9, 0, 1, 0, 11, 12, 69, 71, 22], ["+", 8, 9, 0, 1, 0, 11, 12, 69, 71, 22]]
0
99
6
#include <stdio.h> int main() { char str[20], stra[20]; int i, c = 0; scanf("%s", &str); while (1) { stra[c] = str[c]; if (str[c] == '\0') { break; } c++; } for (i = 0; i < c; i++) { str[i] = stra[c - 1 - i]; } stra[c] = '\0'; printf("%sbus\n", str); return 0; }
#include <stdio.h> int main() { char str[21], stra[21]; int i, c = 0; scanf("%s", &str); while (1) { stra[c] = str[c]; if (str[c] == '\0') { break; } c++; } for (i = 0; i < c; i++) { str[i] = stra[c - 1 - i]; } stra[c] = '\0'; printf("%s\n", str); return 0; }
[["-", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
0
121
6
#include <stdio.h> void put_rstring(const char str[]) { unsigned length = 0; while (str[length]) length++; for (; length > 0; length--) putchar(str[length - 1]); } int main() { char str[21]; scanf("%s", str); put_rstring(str); printf("%s\n", str); return 0; }
#include <stdio.h> void put_rstring(const char str[]) { unsigned length = 0; while (str[length]) length++; for (; length > 0; length--) putchar(str[length - 1]); } int main() { char str[21]; scanf("%s", str); put_rstring(str); putchar('\n'); return 0; }
[["-", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 62], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 103, 0, 104], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 21], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22]]
0
87
9
#include "stdio.h" #include "string.h" int main() { char str[22]; int i = 0; int flag = 0; memset(str, '0', 22); fgets(str, sizeof(str - 1), stdin); for (i = 20, flag = 0; i >= 0; i--) { if (str[i] == 0) { flag++; } else if (flag == 1 && str[i] != 10) { printf("%c", str[i]); } } printf("\n"); return 0; }
#include "stdio.h" #include "string.h" int main() { char str[21]; int i = 0; int flag = 0; memset(str, '0', 21); fgets(str, sizeof(str), stdin); for (i = 20, flag = 0; i >= 0; i--) { if (str[i] == 0) { flag++; } else if (flag == 1 && str[i] != 10) { printf("%c", str[i]); } } printf("\n"); return 0; }
[["-", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["-", 3, 4, 0, 105, 51, 23, 0, 16, 17, 33], ["-", 3, 4, 0, 105, 51, 23, 0, 16, 12, 13]]
0
126
6
#include <iostream> #include <string> using namespace std; int main(void) { string str; cin >> str; for (int i = str.size() - 1; i <= 0; i--) cout << str[i]; cout << endl; }
#include <iostream> #include <string> using namespace std; int main(void) { string str; cin >> str; for (int i = str.size() - 1; i >= 0; i--) cout << str[i]; cout << endl; }
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 20]]
1
53
2
#include <iostream> #include <string> using namespace std; int main() { string str; while (1) { cin >> str; if (cin.eof()) break; for (int i = (str.size() - 1); i > 0; i--) cout << str[i]; cout << endl; } return 0; }
#include <iostream> #include <string> using namespace std; int main() { string str; while (1) { cin >> str; if (cin.eof()) break; for (int i = (str.size() - 1); i >= 0; i--) cout << str[i]; cout << endl; } return 0; }
[["-", 0, 52, 8, 9, 0, 7, 15, 16, 17, 47], ["+", 0, 52, 8, 9, 0, 7, 15, 16, 17, 20]]
1
73
2
#include <stdio.h> #include <string.h> int main() { char str[21] = {}; char ch; int n; scanf("%s", str); n = strlen(str); for (int i = 0; i < n; i++) { printf("%c", str[n - 1]); } printf("\n"); return 0; }
#include <stdio.h> #include <string.h> int main() { char str[21] = {}; char ch; int n; scanf("%s", str); n = strlen(str); for (int i = 0; i < n; i++) { printf("%c", str[n - i - 1]); } printf("\n"); return 0; }
[["+", 0, 69, 341, 342, 0, 16, 31, 16, 12, 22], ["+", 3, 4, 0, 69, 341, 342, 0, 16, 17, 33]]
1
81
2
#include <iostream> #include <string> using namespace std; int main() { string str; cin >> str; for (int i = str.size() - 1; i >= 0; i++) cout << str[i]; cout << endl; return 0; }
#include <iostream> #include <string> using namespace std; int main() { string str; cin >> str; for (int i = str.size() - 1; i >= 0; i--) cout << str[i]; cout << endl; return 0; }
[["-", 0, 14, 8, 9, 0, 7, 26, 27, 17, 29], ["+", 0, 14, 8, 9, 0, 7, 26, 27, 17, 68]]
1
55
2
#include <iostream> #include <stdio.h> int main() { int i; char s[21]; scanf("&s", s); for (i = 0; s[i] != '\0'; i++) ; if (i > 0) i--; for (; i >= 0; i--) std::cout << s[i]; std::cout << std::endl; return 0; }
#include <iostream> #include <stdio.h> int main() { int i; char s[21]; scanf("%s", s); for (i = 0; s[i] != '\0'; i++) ; if (i > 0) i--; for (; i >= 0; i--) std::cout << s[i]; std::cout << std::endl; return 0; }
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
1
86
2
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; for (int i = s.size() - 1; i >= 0; ++i) cout << s[i]; cout << endl; }
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; for (int i = s.size() - 1; i >= 0; --i) cout << s[i]; cout << endl; }
[["-", 0, 14, 8, 9, 0, 7, 26, 27, 17, 29], ["+", 0, 14, 8, 9, 0, 7, 26, 27, 17, 68]]
1
50
2
#include <algorithm> #include <iostream> using namespace std; int main() { string s; reverse(s.begin(), s.end()); cout << s << endl; }
#include <algorithm> #include <iostream> using namespace std; int main() { string s; cin >> s; reverse(s.begin(), s.end()); cout << s << endl; }
[["+", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
38
4
#include <iostream> using namespace std; int main() { string in, buf; int f = 0, b; cin >> in; b = in.size() - 1; while (b - f > 1) { buf = in[f]; in[f] = in[b]; in[b] = buf[0]; f++; b--; } cout << in << endl; return 0; }
#include <iostream> using namespace std; int main() { string in, buf; int f = 0, b; cin >> in; b = in.size() - 1; while (b - f >= 1) { buf = in[f]; in[f] = in[b]; in[b] = buf[0]; f++; b--; } cout << in << endl; return 0; }
[["-", 8, 9, 0, 52, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 52, 15, 339, 51, 16, 17, 20]]
1
90
2
#include <iostream> #include <string> using namespace std; int main() { string s; cin >> s; for (int i = s.size() - 1; i--;) { cout << s[i]; } cout << endl; }
#include <iostream> #include <string> using namespace std; int main() { string s; cin >> s; for (int i = s.size(); i--;) { cout << s[i]; } cout << endl; }
[["-", 0, 7, 10, 43, 49, 50, 51, 16, 17, 33], ["-", 0, 7, 10, 43, 49, 50, 51, 16, 12, 13]]
1
51
2
#include <iostream> using namespace std; int main(void) { string str; cin >> str; int l = str.size(); for (int i = l; i >= 0; i++) { cout << str[i]; } cout << endl; return 0; }
#include <iostream> using namespace std; int main(void) { string str; cin >> str; int l = str.size(); for (int i = l; i > 0; i--) { cout << str[i - 1]; } cout << endl; return 0; }
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 20], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 47], ["-", 0, 14, 8, 9, 0, 7, 26, 27, 17, 29], ["+", 0, 14, 8, 9, 0, 7, 26, 27, 17, 68], ["+", 0, 16, 12, 69, 341, 342, 0, 16, 17, 33], ["+", 0, 16, 12, 69, 341, 342, 0, 16, 12, 13]]
1
59
6
#include <iostream> #include <string> using namespace std; int main() { string str; cin >> str; for (int i = str.size(); i > 0; --i) cout << str[i - 1] << endl; return 0; }
#include <iostream> #include <string> using namespace std; int main() { string str; cin >> str; for (int i = str.size(); i > 0; --i) cout << str[i - 1]; cout << endl; return 0; }
[["+", 0, 14, 8, 9, 0, 7, 8, 1, 0, 35], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22]]
1
53
2
#include <iostream> #include <string> using namespace std; int main() { string str; cin >> str; for (int i = str.size() - 1; i >= 0; i++) { cout << str[i]; } cout << endl; return 0; }
#include <iostream> #include <string> using namespace std; int main() { string str; cin >> str; for (int i = str.size() - 1; i >= 0; i--) { cout << str[i]; } cout << endl; return 0; }
[["-", 0, 14, 8, 9, 0, 7, 26, 27, 17, 29], ["+", 0, 14, 8, 9, 0, 7, 26, 27, 17, 68]]
1
57
2
#include <algorithm> #include <iostream> #include <string> using namespace std; main() { string str; cin >> str; for (int i = str.size() - 1; i >= 0; --i) cout << str[i] << endl; }
#include <algorithm> #include <iostream> #include <string> using namespace std; main() { string str; cin >> str; for (int i = str.size() - 1; i >= 0; --i) cout << str[i]; cout << endl; }
[["+", 0, 14, 8, 9, 0, 7, 8, 1, 0, 35], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22]]
1
51
2
#include <iostream> #include <string> using namespace std; int main() { string A; char R; cin >> A; for (int i = 0; i <= A.length() / 2; i++) { R = A[i]; A[i] = A[A.length() - i - 1]; A[A.length() - i - 1] = R; } cout << A << "\n"; return 0; }
#include <iostream> #include <string> using namespace std; int main() { string A; char R; cin >> A; for (int i = 0; i < A.length() / 2; i++) { R = A[i]; A[i] = A[A.length() - i - 1]; A[A.length() - i - 1] = R; } cout << A << "\n"; return 0; }
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18]]
1
97
2
#include <iostream> #include <string.h> using namespace std; int main() { char a[20]; cin >> a; for (int i = strlen(a) - 1; i > 0; i--) { cout << a[i] << endl; } return 0; }
#include <iostream> #include <string.h> using namespace std; int main() { char a[20]; cin >> a; for (int i = strlen(a) - 1; i >= 0; i--) { cout << a[i]; } cout << endl; return 0; }
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 47], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 20], ["+", 8, 9, 0, 7, 8, 9, 0, 1, 0, 35], ["+", 0, 14, 8, 9, 0, 7, 8, 9, 0, 46], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["-", 0, 14, 8, 9, 0, 7, 8, 9, 0, 46]]
1
57
6
#include <stdio.h> #include <string.h> int main(void) { char str[20]; scanf("%s", str); for (int i = strlen(str) - 1; i > 0; i--) printf("%s", str[i - 1]); printf("\n"); return 0; }
#include <stdio.h> #include <string.h> int main(void) { char str[20]; scanf("%s", str); for (int i = strlen(str) - 1; i >= 0; i--) { printf("%c", str[i]); } printf("\n"); return 0; }
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 47], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 20], ["+", 0, 14, 8, 9, 0, 7, 8, 9, 0, 45], ["-", 8, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["-", 3, 4, 0, 69, 341, 342, 0, 16, 17, 33], ["-", 3, 4, 0, 69, 341, 342, 0, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 8, 9, 0, 46]]
1
69
8
#include <iostream> #include <string> using namespace std; int main() { string s; cin >> s; for (int i = s.size() - 1; i > 0; i--) { cout << s[i]; } cout << endl; return 0; }
#include <iostream> #include <string> using namespace std; int main() { string s; cin >> s; for (int i = s.size() - 1; i >= 0; i--) { cout << s[i]; } cout << endl; return 0; }
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 47], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 20]]
1
57
2
#include <iostream> #include <string> using namespace std; int main() { string s; cin >> s; for (int i = 1; i < s.length(); i++) { cout << s[s.length() - i]; } cout << endl; return 0; }
#include <iostream> #include <string> using namespace std; int main() { string s; cin >> s; for (int i = 1; i < s.length() + 1; i++) { cout << s[s.length() - i]; } cout << endl; return 0; }
[["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
61
2
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); String moji; char[] charmoji; while (scan.hasNext() == true) { moji = scan.next(); charmoji = moji.toCharArray(); for (int i = 0; i < charmoji.length; i++) { char tmp = charmoji[0]; charmoji[0] = charmoji[charmoji.length - 1 - i]; charmoji[charmoji.length - 1 - i] = tmp; } moji = String.valueOf(charmoji); System.out.println(moji); } scan.close(); } }
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); String moji; char[] charmoji; while (scan.hasNext() == true) { moji = scan.next(); charmoji = moji.toCharArray(); for (int i = 0; i < charmoji.length / 2; i++) { char tmp = charmoji[i]; charmoji[i] = charmoji[charmoji.length - 1 - i]; charmoji[charmoji.length - 1 - i] = tmp; } moji = String.valueOf(charmoji); System.out.println(moji); } scan.close(); } }
[["+", 8, 196, 0, 7, 15, 16, 12, 16, 17, 85], ["+", 8, 196, 0, 7, 15, 16, 12, 16, 12, 499], ["-", 8, 196, 0, 503, 49, 200, 51, 504, 71, 499], ["+", 8, 196, 0, 503, 49, 200, 51, 504, 71, 22], ["-", 8, 196, 0, 1, 0, 11, 31, 504, 71, 499], ["+", 8, 196, 0, 1, 0, 11, 31, 504, 71, 22]]
3
150
6
import java.util.Scanner; public class Main { Scanner sc = new Scanner(System.in); void run() { char c[] = sc.next().toCharArray(); int l = c.length; while (l-- != 0) { System.out.print(c[l]); System.out.println(); } } public static void main(String[] args) { new Main().run(); } }
import java.util.Scanner; public class Main { Scanner sc = new Scanner(System.in); void run() { char c[] = sc.next().toCharArray(); int l = c.length; while (l-- != 0) { System.out.print(c[l]); } System.out.println(); } public static void main(String[] args) { new Main().run(); } }
[["+", 0, 195, 8, 196, 0, 52, 8, 196, 0, 46], ["-", 0, 195, 8, 196, 0, 52, 8, 196, 0, 46]]
3
101
2
#include <stdio.h> #include <string.h> int main(void) { char *s; int i; scanf("%s", s); int len = strlen(s); for (i = len - 1; i >= 0; i--) putchar(s[i]); putchar('\n'); return 0; }
#include <stdio.h> #include <string.h> int main(void) { char s[21]; int i; scanf("%s", s); int len = strlen(s); for (i = len - 1; i >= 0; i--) putchar(s[i]); putchar('\n'); return 0; }
[["-", 0, 14, 8, 9, 0, 43, 49, 84, 0, 48], ["+", 0, 14, 8, 9, 0, 43, 49, 80, 0, 70], ["+", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 80, 0, 73]]
0
68
4
#include <stdio.h> #include <string.h> int main() { char a[21]; int i = 0; scanf("%s", a); i = strlen(a); i--; while (i != 0) { printf("%c", a[i]); i--; } printf("\n"); return 0; }
#include <stdio.h> #include <string.h> int main() { char a[21]; int i = 0; scanf("%s", a); i = strlen(a); i--; while (i >= 0) { printf("%c", a[i]); i--; } printf("\n"); return 0; }
[["-", 8, 9, 0, 52, 15, 23, 0, 16, 17, 79], ["+", 8, 9, 0, 52, 15, 23, 0, 16, 17, 20]]
0
73
2
#include <stdio.h> #include <string.h> int main(void) { char str[25], temp; int i, len; scanf("%s", str); len = strlen(str); for (i = 0; i < len - 1; i++) { temp = str[i]; str[i] = str[len - 1 - i]; str[len - 1 - i] = temp; } printf("%s\n", str); return 0; }
#include <stdio.h> #include <string.h> int main(void) { char str[25], temp; int i, len; scanf("%s", str); len = strlen(str); for (i = 0; i <= (len - 1) / 2; i++) { temp = str[i]; str[i] = str[len - 1 - i]; str[len - 1 - i] = temp; } printf("%s\n", str); return 0; }
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19], ["+", 0, 7, 15, 16, 12, 16, 31, 23, 0, 24], ["+", 0, 7, 15, 16, 12, 16, 31, 23, 0, 25], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 85], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
0
102
6
#include <stdio.h> #include <string.h> int main() { int i; char str[21]; scanf("%c", str); for (i = strlen(str) - 1; i >= 0; --i) { putchar(str[i]); } printf("?\n"); return (0); }
#include <stdio.h> #include <string.h> int main() { int i; char str[21]; scanf("%s", str); for (i = strlen(str) - 1; i >= 0; --i) { putchar(str[i]); } printf("\n"); return (0); }
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
0
69
3
#include <stdio.h> void inverse(char str[], char inv[]); int main() { char str[21], inv[21]; while (scanf("%c", str) != -1) { inverse(str, inv); printf("%s", inv); } return 0; } void inverse(char str[], char inv[]) { int i, j; for (i = 0; str[i] != '\0'; i++) ; for (j = 0; j < i; j++) { inv[j] = str[i - j]; } inv[j] = '\0'; }
#include <stdio.h> void inverse(char str[], char inv[]); int main() { char str[21], inv[21]; while (scanf("%s", str) != -1) { inverse(str, inv); printf("%s\n", inv); } return 0; } void inverse(char str[], char inv[]) { int i, j; for (i = 0; str[i] != '\0'; i++) ; for (j = 0; j < i; j++) { inv[j] = str[i - j - 1]; } inv[j] = '\0'; }
[["-", 0, 16, 31, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 16, 31, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44], ["+", 0, 1, 0, 11, 12, 69, 71, 16, 17, 33], ["+", 0, 1, 0, 11, 12, 69, 71, 16, 12, 13]]
0
142
5
#include <stdio.h> int main() { char str[21]; int len; int i; char tmp; scanf("%s", str); len = strlen(str); for (i = 0; i < len / 2; i++) { tmp = str[i]; str[i] = str[len - 1 - i]; str[len - 1 - i] = tmp; } printf("%s\n"); return 0; }
#include <stdio.h> int main() { char str[21]; int len; int i; char tmp; scanf("%s", str); len = strlen(str); for (i = 0; i < len / 2; i++) { tmp = str[i]; str[i] = str[len - 1 - i]; str[len - 1 - i] = tmp; } printf("%s\n", str); return 0; }
[["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 21], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22]]
0
99
2
#include <stdio.h> #include <string.h> int main(void) { int i = 0; char text[20] = {}; char x; scanf("%s", text); while (i < (strlen(text) - 1) / 2) { x = text[i]; text[i] = text[strlen(text) - 1 - i]; text[strlen(text) - 1 - i] = x; i++; } printf("%s\n", text); return (0); }
#include <stdio.h> #include <string.h> int main(void) { int i = 0; char text[20] = {}; char x; scanf("%s", text); while (i <= (strlen(text) - 1) / 2) { x = text[i]; text[i] = text[strlen(text) - 1 - i]; text[strlen(text) - 1 - i] = x; i++; } printf("%s\n", text); return (0); }
[["-", 8, 9, 0, 52, 15, 23, 0, 16, 17, 18], ["+", 8, 9, 0, 52, 15, 23, 0, 16, 17, 19]]
0
110
2
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <string.h> #define U1 unsigned char #define S1 char #define S4 int #define MAX_LENGTH (21) /* ヌル文字込みの最大入力文字数 */ S4 main() { U1 u1_tp_input[MAX_LENGTH]; /* 反転したい文字列 */ S1 s1_t_idx; /* 文字列反転処理で処理中の文字を指すインデックス */ U1 u1_t_strLength; /* 文字列の長さ */ /* 入力 */ (void)scanf("%s", u1_tp_input); /* 文字列の長さを計算 */ u1_t_strLength = (U1)strlen((const char *)u1_tp_input); /* 末尾から先頭に向かって文字を出力 */ for (s1_t_idx = (S1)u1_t_strLength; s1_t_idx >= (S1)0; s1_t_idx--) { printf("%c", u1_tp_input[s1_t_idx - 1]); } printf("\n"); return ((S4)0); }
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <string.h> #define U1 unsigned char #define S1 char #define S4 int #define MAX_LENGTH (21) /* ヌル文字込みの最大入力文字数 */ S4 main() { U1 u1_tp_input[MAX_LENGTH]; /* 反転したい文字列 */ S1 s1_t_idx; /* 文字列反転処理で処理中の文字を指すインデックス */ U1 u1_t_strLength; /* 文字列の長さ */ /* 入力 */ scanf("%s", u1_tp_input); /* 文字列の長さを計算 */ u1_t_strLength = (U1)strlen((const char *)u1_tp_input); /* 末尾から先頭に向かって文字を出力 */ for (s1_t_idx = (S1)u1_t_strLength; s1_t_idx > (S1)0; s1_t_idx--) { printf("%c", u1_tp_input[s1_t_idx - 1]); } printf("\n"); return ((S4)0); }
[["-", 0, 14, 8, 9, 0, 1, 0, 74, 0, 24], ["-", 8, 9, 0, 1, 0, 74, 39, 77, 39, 40], ["-", 0, 14, 8, 9, 0, 1, 0, 74, 0, 25], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 20], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 47]]
0
120
5
#include <stdio.h> #include <string.h> int main() { char buff[1024]; char result[1024]; int length; fgets(buff, 1024, stdin); length = strlen(buff); int i, j; for (i = length - 3, j = 0; i >= 0; i--, j++) { result[j] = buff[i]; } result[j] = '\0'; printf("%s\n", result); return 0; }
#include <stdio.h> #include <string.h> int main() { char buff[64]; char result[64]; int length; fgets(buff, 64, stdin); length = strlen(buff); int i, j; for (i = length - 2, j = 0; i >= 0; i--, j++) { result[j] = buff[i]; } result[j] = '\0'; printf("%s\n", result); return 0; }
[["-", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["-", 0, 7, 10, 34, 31, 11, 12, 16, 12, 13], ["+", 0, 7, 10, 34, 31, 11, 12, 16, 12, 13]]
0
102
8
#include <stdio.h> #include <string.h> int main(void) { char str[100]; scanf("%s", str); int len = strlen(str); while (len-- != 0) { printf("%c", str[len]); puts(""); } return 0; }
#include <stdio.h> #include <string.h> int main(void) { char str[100]; scanf("%s", str); int len = strlen(str); while (len-- != 0) { printf("%c", str[len]); } puts(""); return 0; }
[["+", 0, 14, 8, 9, 0, 52, 8, 9, 0, 46], ["-", 0, 14, 8, 9, 0, 52, 8, 9, 0, 46]]
0
64
2
main(i) { i - 10 && main(getc(0)) & putchar(i - 1 ? i : 10); }
main(i) { return i - 10 && main(getchar()) & putchar(i - 1 ? i : 10); }
[["+", 0, 30, 0, 14, 8, 9, 0, 37, 0, 38], ["-", 12, 16, 31, 2, 3, 4, 0, 2, 63, 22], ["+", 12, 16, 31, 2, 3, 4, 0, 2, 63, 22], ["-", 31, 2, 3, 4, 0, 2, 3, 4, 0, 13]]
0
29
5
i = 20; char s[]; main(i) { scanf("%s", s); for (; i;) putchar(s[--i]); i = !puts(""); }
i = 20; char s[20]; main() { scanf("%s", s); for (; i;) putchar(s[--i]); i = !puts(""); }
[["+", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13], ["-", 36, 36, 0, 30, 0, 14, 49, 65, 0, 22], ["+", 0, 1, 0, 2, 3, 4, 0, 25, 0, 35]]
0
48
8
i = 20; char s[]; main(i) { scanf("%s", s); for (; i;) putchar(s[--i]); i = !puts(""); }
i = 20; char s[20]; main() { scanf("%s", s); for (; i;) putchar(s[--i]); i = !putchar(10); }
[["+", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13], ["-", 36, 36, 0, 30, 0, 14, 49, 65, 0, 22], ["+", 0, 1, 0, 2, 3, 4, 0, 25, 0, 35], ["-", 0, 1, 0, 11, 12, 91, 28, 2, 63, 22], ["+", 0, 1, 0, 11, 12, 91, 28, 2, 63, 22], ["-", 12, 91, 28, 2, 3, 4, 0, 5, 0, 62], ["+", 0, 11, 12, 91, 28, 2, 3, 4, 0, 13]]
0
48
8
b[99]; main(i, j) { for (i = 0; (j = ~getchar()) ? b[i++] = j : i ? putchar(~b[--i]) : !puts(""); b[i - 1] - ~10 && i--) ; }
b[99]; main(i, j) { for (i = 0; (j = ~getchar()) ? b[i++] = j : i ? putchar(~b[--i]) : !puts(""); b[i - 1] - ~10 || i--) ; }
[["-", 0, 30, 0, 9, 0, 7, 26, 16, 17, 98], ["+", 0, 30, 0, 9, 0, 7, 26, 16, 17, 106]]
0
70
2