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
#include <cmath> #include <iostream> int main() { int a, b; while (std::cin >> a >> b) std::cout << log10(a + b) << std::endl; return 0; }
#include <cmath> #include <iostream> int main() { int a, b; while (std::cin >> a >> b) std::cout << trunc(log10(a + b)) + 1 << std::endl; return 0; }
[["+", 0, 16, 31, 16, 12, 16, 31, 2, 63, 22], ["+", 31, 16, 12, 16, 31, 2, 3, 4, 0, 24], ["+", 31, 16, 12, 16, 31, 2, 3, 4, 0, 25], ["+", 8, 1, 0, 16, 31, 16, 12, 16, 17, 72], ["+", 8, 1, 0, 16, 31, 16, 12, 16, 12, 13]]
1
43
#include <iostream> using namespace std; int main() { int a, b, i, ans, sum = 0; while (cin >> a >> b) { ans = a + b; for (i = 0; ans > 0; i++) { ans = ans / 10; sum = sum + 1; } cout << sum << endl; } return 0; }
#include <iostream> using namespace std; int main() { long long a, b, i, ans, sum = 0; while (cin >> a >> b) { ans = a + b; for (i = 0; ans > 0; i++) { ans = ans / 10; sum = sum + 1; } cout << sum << endl; sum = 0; } 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, 52, 8, 9, 0, 1, 0, 35], ["+", 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]]
1
77
#include <bits/stdc++.h> using namespace std; int a, b; int main() { while (scanf("%d %d", &a, &b) != EOF) { int i; a = a + b; while (a > 0) { a = a / 10; ++i; } cout << i << endl; } }
#include <bits/stdc++.h> using namespace std; int a, b; int main() { while (scanf("%d %d", &a, &b) != EOF) { int i = 0; a = a + b; while (a > 0) { a = a / 10; ++i; } cout << i << endl; } }
[["+", 0, 52, 8, 9, 0, 43, 49, 50, 0, 32], ["+", 0, 52, 8, 9, 0, 43, 49, 50, 51, 13]]
1
68
#include <iostream> #include <string> using namespace std; int main() { string ans; int a, b; cin >> a >> b; cout << to_string(a + b).length() << endl; }
#include <iostream> #include <string> using namespace std; int main() { string ans; int a, b; while (cin >> a >> b) { cout << to_string(a + b).length() << 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
43
#include "bits/stdc++.h" using namespace std; int main() { int a, b; cin >> a >> b; int n = a + b; int ans = 0; while (n > 0) { n /= 10; ans++; } if (ans == 0) ans++; cout << ans << endl; return 0; }
#include "bits/stdc++.h" using namespace std; int main() { int a, b; while (cin >> a >> b) { int n = a + b; int ans = 0; while (n > 0) { n /= 10; ans++; } if (ans == 0) ans++; cout << ans << 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
70
#include <iostream> #include <stdio.h> #include <string.h> using namespace std; int main() { int a, b, c; char ans[100]; cin >> a >> b; sprintf(ans, "%d", a + b); c = strlen(ans); cout << c << endl; return 0; }
#include <iostream> #include <stdio.h> #include <string.h> using namespace std; int main() { int a, b, c; char ans[100]; while (cin >> a >> b) { sprintf(ans, "%d", a + b); c = strlen(ans); cout << c << 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
64
#include <iostream> #include <sstream> using namespace std; int main() { int a, b; stringstream ss; while (cin >> a >> b) { ss << a + b; cout << ss.str().size() << endl; } return 0; }
#include <iostream> #include <sstream> using namespace std; int main() { int a, b; while (cin >> a >> b) { stringstream ss; ss << a + b; cout << ss.str().size() << endl; } return 0; }
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 49, 22], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["+", 8, 9, 0, 52, 8, 9, 0, 43, 39, 78], ["+", 8, 9, 0, 52, 8, 9, 0, 43, 49, 22], ["+", 8, 9, 0, 52, 8, 9, 0, 43, 0, 35]]
1
55
#include <algorithm> #include <cmath> #include <cstdio> #include <iomanip> #include <iostream> using namespace std; const int M = 100000; const double pi = 3.141592653589; int main() { int a, b; cin >> a >> b; a = a + b; int count = 0; while (a > 0) { a /= 10; count++; } printf("%d\n", count); }
#include <algorithm> #include <cmath> #include <cstdio> #include <iomanip> #include <iostream> using namespace std; const int M = 100000; const double pi = 3.141592653589; int main() { int a, b; while (cin >> a >> b) { a = a + b; int count = 0; while (a > 0) { a /= 10; count++; } printf("%d\n", count); } }
[["+", 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
79
#include <iostream> int main() { int a, b; while (std::cin >> a >> b) { a += b; int ans = 0; while (a > 0) { a /= 2; ans++; } std::cout << ans << std::endl; } return 0; }
#include <iostream> int main() { int a, b; while (std::cin >> a >> b) { a += b; int ans = 0; while (a > 0) { a /= 10; ans++; } std::cout << ans << std::endl; } return 0; }
[["-", 0, 52, 8, 9, 0, 1, 0, 11, 12, 13], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 12, 13]]
1
62
#include <iostream> #include <vector> #ifndef EOF #define EOF (-1) #endif int main() { std::vector<int> digits; int a, b; while (scanf("%d %d", &a, &b) != EOF) { int sum = a + b; int t = sum / 10; int digit = 0; while (t > 0) { digit++; t = t / 10; } digits.push_back(digit); } for (int i = 0; i < digits.size(); i++) { std::cout << digits[i] << std::endl; } return 0; }
#include <iostream> #include <vector> #ifndef EOF #define EOF (-1) #endif int main() { std::vector<int> digits; int a, b; while (scanf("%d %d", &a, &b) != EOF) { int sum = a + b; int t = sum / 10; int digit = 1; while (t > 0) { digit++; t = t / 10; } digits.push_back(digit); } for (int i = 0; i < digits.size(); i++) { std::cout << digits[i] << std::endl; } return 0; }
[["-", 0, 52, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 52, 8, 9, 0, 43, 49, 50, 51, 13]]
1
127
#include <iostream> using namespace std; int main() { int a, b; cin >> a >> b; a += b; int ans = 0; while (a != 0) { a = a / 10; ans++; } cout << ans << endl; return 0; }
#include <iostream> using namespace std; int main() { int a, b; while (cin >> a >> b) { a += b; int ans = 0; while (a != 0) { a = a / 10; ans++; } cout << ans << 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
58
#include <iostream> #include <sstream> #include <string> #include <vector> using namespace std; void readData(vector<string> &input_data) { string buff; while (getline(cin, buff)) input_data.push_back(buff); } int perseString(string line) { stringstream ss; ss << line; int a, b; ss >> a >> b; return a + b; } int countDigit(int n) { int cnt = 1; while (n /= 10) ++cnt; return cnt; } void mainRoutine() { vector<string> input_data; readData(input_data); for (int i = 0; i < input_data.size(); ++i) { auto ret = perseString("100 200"); cout << countDigit(ret) << endl; } } int main() { mainRoutine(); return 0; }
#include <iostream> #include <sstream> #include <string> #include <vector> using namespace std; void readData(vector<string> &input_data) { string buff; while (getline(cin, buff)) input_data.push_back(buff); } int perseString(string line) { stringstream ss; ss << line; int a, b; ss >> a >> b; return a + b; } int countDigit(int n) { int cnt = 1; while (n /= 10) ++cnt; return cnt; } void mainRoutine() { vector<string> input_data; readData(input_data); for (int i = 0; i < input_data.size(); ++i) { auto ret = perseString(input_data[i]); cout << countDigit(ret) << endl; } } int main() { mainRoutine(); return 0; }
[["-", 49, 50, 51, 2, 3, 4, 0, 5, 0, 62], ["-", 49, 50, 51, 2, 3, 4, 0, 5, 0, 6], ["+", 49, 50, 51, 2, 3, 4, 0, 69, 28, 22], ["+", 51, 2, 3, 4, 0, 69, 341, 342, 0, 70], ["+", 51, 2, 3, 4, 0, 69, 341, 342, 0, 22], ["+", 51, 2, 3, 4, 0, 69, 341, 342, 0, 73]]
1
168
#include <math.h> #include <stdio.h> int main(void) { int a, b; while (scanf("%d%d", &a, &b) != EOF) { int c = a + b; int d = (int)log10(c); printf("%d\n", d); } return 0; }
#include <math.h> #include <stdio.h> int main(void) { int a, b; while (scanf("%d%d", &a, &b) != EOF) { int c = a + b; int d = (int)log10(c) + 1; printf("%d\n", d); } return 0; }
[["+", 8, 9, 0, 43, 49, 50, 51, 16, 17, 72], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 12, 13]]
1
66
#include <bits/stdc++.h> using namespace std; int main() { int a, b; while (cin >> a >> b) { cout << (int)log10(a + b) << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int a, b; while (cin >> a >> b) { cout << (int)log10(a + b) + 1 << endl; } return 0; }
[["+", 0, 1, 0, 16, 31, 16, 12, 16, 17, 72], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 12, 13]]
1
44
#include <iostream> using namespace std; int main() { int i1, i2; cin >> i1 >> i2; i1 += i2; i2 = 0; while (i1) { i2++; i1 /= 10; } cout << i2 << endl; return 0; }
#include <iostream> using namespace std; int main() { int i1, i2; while (cin >> i1 >> i2) { i1 += i2; i2 = 0; while (i1) { i2++; i1 /= 10; } cout << i2 << 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
53
#include <bits/stdc++.h> using namespace std; int main() { int a, b; cin >> a >> b; string s = to_string(a + b); cout << s.size() << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int a, b; while (cin >> a >> b) { string s = to_string(a + b); cout << s.size() << 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
46
#include <iostream> #include <string> using namespace std; int main() { int a, b, i; cin >> a >> b; a += b; for (i = 1;; i++) { if (a < 10) { break; } a = a / 10; } cout << i << endl; }
#include <iostream> #include <string> using namespace std; int main() { int a, b, i; while (cin >> a >> b) { a += b; for (i = 1;; i++) { if (a < 10) { break; } a = a / 10; } cout << i << 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
65
#include <iostream> #include <math.h> #include <stdio.h> #include <vector> using namespace std; int main(void) { int a = 0, b = 0, n = 1; vector<int> r; while (scanf("%d %d", &a, &b) != EOF) { while ((a + b) >= pow(10, n)) { n++; } r.push_back(n); } for (int i = 0; i < r.size(); i++) { cout << r[i] << endl; } return 0; }
#include <iostream> #include <math.h> #include <stdio.h> #include <vector> using namespace std; int main(void) { int a = 0, b = 0, n = 1; vector<int> r; while (scanf("%d %d", &a, &b) != EOF) { n = 1; while ((a + b) >= pow(10, n)) { n++; } r.push_back(n); } for (int i = 0; i < r.size(); i++) { cout << r[i] << endl; } 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]]
1
116
#include <iostream> using namespace std; int main() { int a, b; while (cin >> a >> b) { int k = 1, stac = a + b; while (stac > 10) { stac /= 10; k++; } cout << k << "\n"; } }
#include <iostream> using namespace std; int main() { int a, b; while (cin >> a >> b) { int k = 1, stac = a + b; while (stac >= 10) { stac /= 10; k++; } cout << k << "\n"; } }
[["-", 8, 9, 0, 52, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 52, 15, 339, 51, 16, 17, 20]]
1
61
#include <algorithm> #include <functional> #include <iostream> #include <sstream> #include <vector> using namespace std; // Digit Number(0002) int main() { int a, b; cin >> a >> b; stringstream ss; ss << a + b; cout << ss.str().length() << endl; return 0; }
#include <algorithm> #include <functional> #include <iostream> #include <sstream> #include <vector> using namespace std; // Digit Number(0002) int main() { int a, b; while (cin >> a >> b) { stringstream ss; ss << a + b; cout << ss.str().length() << 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
58
#include <cstdio> using namespace std; int toLowUnder10(int arg) { return (10 > arg) ? arg : (toLowUnder10(arg / 10) + 1); } int main(int argc, char *argv[]) { int a, b; while (EOF != fscanf(stdin, "%d %d", &a, &b)) { printf("%d\n", toLowUnder10(a + b)); } return 0; }
#include <cstdio> int toLowUnder10(int arg) { return (10 > arg) ? 1 : (toLowUnder10(arg / 10) + 1); } int main(int argc, char *argv[]) { int a, b; while (EOF != fscanf(stdin, "%d %d", &a, &b)) { printf("%d\n", toLowUnder10(a + b)); } return 0; }
[["-", 36, 36, 36, 36, 0, 30, 0, 340, 0, 233], ["-", 36, 36, 36, 36, 0, 30, 0, 340, 0, 256], ["-", 36, 36, 36, 36, 0, 30, 0, 340, 0, 22], ["-", 36, 36, 36, 36, 0, 30, 0, 340, 0, 35], ["-", 0, 14, 8, 9, 0, 37, 0, 41, 64, 22], ["+", 0, 14, 8, 9, 0, 37, 0, 41, 64, 13]]
1
92
#include <iostream> using namespace std; int main(int argc, char const *argv[]) { int a, b, c; cin >> a >> b; int i; c = a + b; for (i = 0; (c /= 10) != 0; i++) ; cout << ++i << endl; return 0; }
#include <iostream> using namespace std; int main(int argc, char const *argv[]) { int a, b, c; while (cin >> a >> b) { int i; c = a + b; for (i = 0; (c /= 10) != 0; i++) ; cout << ++i << 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
71
#include <cmath> #include <iostream> using namespace std; int main() { int a, b; while (cin >> a >> b) { cout << (int)(log((double)a + b)) + 1 << endl; } }
#include <cmath> #include <iostream> using namespace std; int main() { int a, b; while (cin >> a >> b) { cout << (int)(log10((double)a + b)) + 1 << endl; } }
[["-", 12, 16, 31, 74, 51, 23, 0, 2, 63, 22], ["+", 12, 16, 31, 74, 51, 23, 0, 2, 63, 22]]
1
50
#include <cstdio> #include <cstdlib> using namespace std; int digit(int num) { if ((num / 10) > 0) return (digit(num / 10)) + 1; else return 1; } int main() { int num1, num2, result = 0; while (fscanf(stdin, "%d %d", &num1, &num2) != EOF) { result = digit(num1 + num2); printf("%d", result); } return 0; }
#include <cstdio> #include <cstdlib> using namespace std; int digit(int num) { if ((num / 10) > 0) return (digit(num / 10)) + 1; else return 1; } int main() { int num1, num2, result = 0; while (fscanf(stdin, "%d %d", &num1, &num2) != EOF) { result = digit(num1 + num2); printf("%d\n", result); } return 0; }
[["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44]]
1
99
#include <stdio.h> int ketasu(int num) { if (num == 0) return 0; int i; for (i = 1; num != 0; i++) { num /= 10; } return i; } int main() { int a, b; while (scanf("%d %d", &a, &b) == EOF) { printf("%d\n", ketasu(a + b)); } return 0; }
#include <stdio.h> int ketasu(int num) { if (num == 0) return 0; int i; for (i = 0; num != 0; i++) { num /= 10; } return i; } int main() { int a, b; while (scanf("%d %d", &a, &b) != EOF) { printf("%d\n", ketasu(a + b)); } return 0; }
[["-", 0, 14, 8, 9, 0, 7, 10, 11, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 10, 11, 12, 13], ["-", 8, 9, 0, 52, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 52, 15, 339, 51, 16, 17, 79]]
1
92
#include <cstdio> int main(void) { int a, b, i, s; while (scanf("%d", &a) != EOF) { scanf("%d", &b); s = a + b; for (i = 1; s > 0; i++) { s /= 10; } printf("%d\n", i); } return 0; }
#include <cstdio> int main(void) { int a, b, i, s; while (scanf("%d", &a) != EOF) { scanf("%d", &b); s = a + b; for (i = 0; s > 0; i++) { s /= 10; } printf("%d\n", i); } return 0; }
[["-", 0, 52, 8, 9, 0, 7, 10, 11, 12, 13], ["+", 0, 52, 8, 9, 0, 7, 10, 11, 12, 13]]
1
82
#include <iostream> using namespace std; main() { int i = 0; double a, b; double sum; while (cin >> a >> b) { sum = a + b; while (sum > 1) { i++; // cout << i << endl; sum /= 10; } cout << i << endl; i = 0; } return 0; }
#include <iostream> using namespace std; main() { int i = 0; double a, b; double sum; while (cin >> a >> b) { sum = a + b; while (sum >= 1) { i++; // cout << i << endl; sum /= 10; } cout << i << endl; i = 0; } return 0; }
[["-", 8, 9, 0, 52, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 52, 15, 339, 51, 16, 17, 20]]
1
69
#include <cstdio> #include <iostream> using namespace std; int sum(int n) { int res = 1; while (n / 10 != 0) { res++; n /= 10; } return res; } int main() { int a, b; while (~scanf("%d %d", &a, &b)) { printf("%d\n", sum(a) + sum(b)); } return 0; }
#include <cstdio> #include <iostream> using namespace std; int sum(int n) { int res = 1; while (n / 10 != 0) { res++; n /= 10; } return res; } int main() { int a, b; while (~scanf("%d %d", &a, &b)) { printf("%d\n", sum(a + b)); } return 0; }
[["-", 3, 4, 0, 16, 31, 2, 3, 4, 0, 25], ["-", 0, 2, 3, 4, 0, 16, 12, 2, 63, 22], ["-", 3, 4, 0, 16, 12, 2, 3, 4, 0, 24]]
1
91
#include <iostream> using namespace std; int main() { const int INF = 10000000; int a, b, c, ans; while (cin >> a >> b) { ans = 1; a += b; for (int i = 0; i < INF; i++) { c = a % 10; a -= c; if (a == 0) { break; } if (a != 0) { ans++; a /= 10; } } cout << ans; } }
#include <iostream> using namespace std; int main() { const int INF = 10000000; int a, b, c, ans; while (cin >> a >> b) { ans = 1; a += b; for (int i = 0; i < INF; i++) { c = a % 10; a -= c; if (a == 0) { break; } if (a != 0) { ans++; a /= 10; } } cout << ans << endl; } }
[["+", 0, 52, 8, 9, 0, 1, 0, 16, 17, 151], ["+", 0, 52, 8, 9, 0, 1, 0, 16, 12, 22]]
1
100
#include <stdio.h> int main() { int l, m, n, i; while (1) { if (scanf("%d %d", &l, &m) == EOF) break; n = l + m; for (i = 1; n >= 9; i++) { n /= 10; } printf("%d\n", i); } return 0; }
#include <stdio.h> int main() { int l, m, n, i; while (1) { if (scanf("%d %d", &l, &m) == EOF) break; n = l + m; for (i = 1; n > 9; i++) { n /= 10; } printf("%d\n", i); } return 0; }
[["-", 0, 52, 8, 9, 0, 7, 15, 16, 17, 20], ["+", 0, 52, 8, 9, 0, 7, 15, 16, 17, 47]]
1
80
#include <iostream> //#include <cstdio> #include <cmath> using namespace std; // 0002 int main() { int a, b, c; while (cin >> a >> b) { c = a + b; cout << 1 + (int)log10(c); } return 0; }
#include <iostream> //#include <cstdio> #include <cmath> using namespace std; // 0002 int main() { int a, b, c; while (cin >> a >> b) { c = a + b; cout << 1 + (int)log10(c) << endl; } return 0; }
[["+", 0, 52, 8, 9, 0, 1, 0, 16, 17, 151], ["+", 0, 52, 8, 9, 0, 1, 0, 16, 12, 22]]
1
54
#include <cstdio> int main() { int a, b; while (scanf("%d %d", &a, &b) != (EOF)) { int count = 1; double d = a + b; while (d >= 10) { d /= 10; count++; } printf("%d", count); } return 0; }
#include <cstdio> int main() { int a, b; while (scanf("%d %d", &a, &b) != EOF) { int count = 1; double d = a + b; while (d >= 10) { d /= 10; count++; } printf("%d\n", count); } return 0; }
[["-", 0, 52, 15, 339, 51, 16, 12, 23, 0, 24], ["-", 0, 14, 8, 9, 0, 52, 15, 339, 0, 25], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44]]
1
73
#include <cmath> #include <iostream> using namespace std; int main() { int a, b; cin >> a >> b; a = log10(a + b) + 1; cout << a << endl; return 0; }
#include <cmath> #include <iostream> using namespace std; int main() { int a, b; while (cin >> a >> b) { a = log10(a + b) + 1; cout << a << 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
45
#include <iostream> using namespace std; int main() { int a, b, ans; while (cin >> a >> b) { a += b; for (ans = 0; a >= 10; ans++) { a = a / 10; } cout << ans << endl; } return 0; }
#include <iostream> using namespace std; int main() { int a, b, ans; while (cin >> a >> b) { a += b; for (ans = 0; a > 0; ans++) { a = a / 10; } cout << ans << endl; } return 0; }
[["-", 0, 52, 8, 9, 0, 7, 15, 16, 17, 20], ["-", 0, 52, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 52, 8, 9, 0, 7, 15, 16, 17, 47], ["+", 0, 52, 8, 9, 0, 7, 15, 16, 12, 13]]
1
63
#include <iostream> using namespace std; int main(void) { unsigned long long int a, b, sum; while (cin >> a >> b) { sum = a + b; unsigned long int ans = 1; while (sum > 10) { sum = sum / 10; ans++; } cout << ans << endl; } return 0; }
#include <iostream> using namespace std; int main(void) { unsigned int a, b, sum; while (cin >> a >> b) { sum = a + b; unsigned int ans = 0; while (sum > 0) { sum = sum / 10; ans++; } cout << ans << endl; } return 0; }
[["-", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 0, 52, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 0, 52, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 52, 8, 9, 0, 43, 49, 50, 51, 13], ["-", 8, 9, 0, 52, 15, 339, 51, 16, 12, 13], ["+", 8, 9, 0, 52, 15, 339, 51, 16, 12, 13]]
1
72
#include <stdio.h> int main() { int x, y; while (scanf("%d %d", &x, &y) != EOF) { int z = x + y; int digCnt = 1; while (z / 10 != 0) { z /= 10; digCnt++; } printf("%d", digCnt); } return 0; }
#include <stdio.h> int main() { int x, y; while (scanf("%d %d", &x, &y) != EOF) { int z = x + y; int digCnt = 1; while (z / 10 != 0) { z /= 10; digCnt++; } printf("%d\n", digCnt); } return 0; }
[["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44]]
1
73
#include <iostream> #include <string> using namespace std; int main() { int a, b; string input; int size = 0; int count = 0; while (cin >> a >> b) { b += a; input = to_string(b); size = input.size(); cout << size; count++; if (count == 199) { break; } } }
#include <iostream> #include <string> using namespace std; int main() { int a, b; string input; int size = 0; int count = 0; while (cin >> a >> b) { b += a; input = to_string(b); size = input.size(); cout << size << endl; count++; if (count == 199) { break; } } }
[["+", 0, 52, 8, 9, 0, 1, 0, 16, 17, 151], ["+", 0, 52, 8, 9, 0, 1, 0, 16, 12, 22]]
1
78
#include <algorithm> #include <functional> #include <iostream> #include <vector> int main(void) { int val1, val2; std::cin >> val1 >> val2; int sum = val1 + val2; int numDigit = 0; while (sum > 0) { sum /= 10; numDigit++; } std::cout << numDigit << std::endl; return 0; }
#include <algorithm> #include <functional> #include <iostream> #include <vector> int main(void) { int val1, val2; while (std::cin >> val1 >> val2) { int sum = val1 + val2; int numDigit = 0; while (sum > 0) { sum /= 10; numDigit++; } std::cout << numDigit << std::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
68
#include <math.h> #include <stdio.h> int main() { int a, b; while (scanf("%d %d", &a, &b) != EOF) { a += b; printf("%d\n", (int)log10(a)); } return 0; }
#include <math.h> #include <stdio.h> int main() { int a, b; while (scanf("%d %d", &a, &b) != EOF) { a += b; printf("%d\n", (int)log10(a) + 1); } return 0; }
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
57
#define _CRT_SECURE_NO_WARNINGS #include <algorithm> #include <cmath> #include <cstdio> #include <functional> #include <iostream> #include <list> #include <map> #include <string> #include <vector> using namespace std; typedef vector<int> ivector; int main() { int a, b; while (scanf("%d,%d", a, b) != EOF) { int dat = log10(a + b); cout << dat << endl; } return 0; }
#define _CRT_SECURE_NO_WARNINGS #include <algorithm> #include <cmath> #include <cstdio> #include <functional> #include <iostream> #include <list> #include <map> #include <string> #include <vector> using namespace std; typedef vector<int> ivector; int main() { int a, b; while (scanf("%d %d", &a, &b) != EOF) { int dat = log10(a + b); cout << dat + 1 << endl; } return 0; }
[["-", 51, 16, 31, 2, 3, 4, 0, 5, 0, 6], ["+", 51, 16, 31, 2, 3, 4, 0, 5, 0, 6], ["+", 51, 16, 31, 2, 3, 4, 0, 66, 17, 67], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 17, 72], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 12, 13]]
1
78
#include <iostream> #include <sstream> #include <string> using namespace std; int main() { int a, b, c; stringstream s; while (cin >> a >> b) { c = a + b; s << c; cout << s.str().size() << endl; } return 0; }
#include <iostream> #include <sstream> #include <string> using namespace std; int main() { int a, b, c; while (cin >> a >> b) { stringstream s; c = a + b; s << c; cout << s.str().size() << endl; } return 0; }
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 49, 22], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["+", 8, 9, 0, 52, 8, 9, 0, 43, 39, 78], ["+", 8, 9, 0, 52, 8, 9, 0, 43, 49, 22], ["+", 8, 9, 0, 52, 8, 9, 0, 43, 0, 35]]
1
63
#include <climits> #include <iostream> #include <utility> using namespace std; int main() { int a, b; cin >> a >> b; int sum = a + b; int keta; if (sum / 1000000 >= 1) keta = 7; else if (sum / 100000 >= 1) keta = 6; else if (sum / 10000 >= 1) keta = 5; else if (sum / 1000 >= 1) keta = 4; else if (sum / 100 >= 1) keta = 3; else if (sum / 10 >= 1) keta = 2; else keta = 1; cout << keta << endl; return 0; }
#include <climits> #include <iostream> #include <utility> using namespace std; int main() { int a, b; while (cin >> a >> b) { int sum = a + b; int keta; if (sum / 1000000 >= 1) keta = 7; else if (sum / 100000 >= 1) keta = 6; else if (sum / 10000 >= 1) keta = 5; else if (sum / 1000 >= 1) keta = 4; else if (sum / 100 >= 1) keta = 3; else if (sum / 10 >= 1) keta = 2; else keta = 1; cout << keta << 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
128
#include <stdio.h> int main(void) { int a, b, c, i; while (scanf("%d %d", &a, &b) != EOF) { c = a + b; for (i = 0; c != 0; i++) { c /= 10; } printf("%d\n", i + 1); } return 0; }
#include <stdio.h> int main(void) { int a, b, c, i; while (scanf("%d %d", &a, &b) != EOF) { c = a + b; for (i = 0; c != 0; i++) { c /= 10; } printf("%d\n", i); } return 0; }
[["-", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
77
#include <stdio.h> int main(void) { int a, b, c, i; while (scanf("%d %d", &a, &b) != EOF) { c = a + b; for (i = 0; c != 0; i++) { c /= 10; } printf("%d\n", i + 1); } return 0; }
#include <stdio.h> int main(void) { int a, b, c, i; while (scanf("%d %d", &a, &b) != EOF) { c = a + b; for (i = 0; c != 0; i++) c /= 10; printf("%d\n", i); } return 0; }
[["-", 0, 52, 8, 9, 0, 7, 8, 9, 0, 45], ["-", 0, 52, 8, 9, 0, 7, 8, 9, 0, 46], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
77
#include <iostream> #include <math.h> using namespace std; int main() { int a, b; cin >> a >> b; cout << floor(log10(a + b)) + 1 << endl; return 0; }
#include <iostream> #include <math.h> using namespace std; int main() { int a, b; while (cin >> a >> b) { cout << floor(log10(a + b)) + 1 << 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
44
#include <iostream> using namespace std; int main() { int number; int digit = 0; int a, b; while (cin >> a >> b) { number = a + b; while (number != 0) { number = number / 10; ++digit; } cout << digit << endl; } return 0; }
#include <iostream> using namespace std; int main() { int number; int digit = 0; int a, b; while (cin >> a >> b) { digit = 0; number = a + b; while (number != 0) { number = number / 10; ++digit; } cout << digit << endl; } 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]]
1
67
#include <iostream> using namespace std; int main() { int a, b; cin >> a >> b; if (a + b < 10) cout << "1" << endl; else if (a + b < 100) cout << "2" << endl; else if (a + b < 1000) cout << "3" << endl; else if (a + b < 10000) cout << "4" << endl; else if (a + b < 100000) cout << "5" << endl; else if (a + b < 1000000) cout << "6" << endl; else if (a + b < 10000000) cout << "7" << endl; else if (a + b < 100000000) cout << "8" << endl; else if (a + b < 10000000000) cout << "9" << endl; return 0; }
#include <iostream> using namespace std; int main() { int a, b; while (cin >> a >> b) { if (a + b < 10) cout << "1" << endl; else if (a + b < 100) cout << "2" << endl; else if (a + b < 1000) cout << "3" << endl; else if (a + b < 10000) cout << "4" << endl; else if (a + b < 100000) cout << "5" << endl; else if (a + b < 1000000) cout << "6" << endl; else if (a + b < 10000000) cout << "7" << endl; else if (a + b < 100000000) cout << "8" << endl; else if (a + b < 10000000000) cout << "9" << 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
178
#include <cmath> #include <iostream> using namespace std; int main() { int a, b, x, keta; while (cin >> a >> b) { x = a + b; keta = log10(x); cout << keta << endl; } }
#include <cmath> #include <iostream> using namespace std; int main() { int a, b, x, keta; while (cin >> a >> b) { x = a + b; keta = log10(x) + 1; cout << keta << endl; } }
[["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 72], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 12, 13]]
1
52
#include <cmath> #include <iostream> using namespace std; int main() { int a, b; while (cin >> a >> b) { a = log10(a + b) + 1; cout << a << endl; return 0; } }
#include <cmath> #include <iostream> using namespace std; int main() { int a, b; while (cin >> a >> b) { a = log10(a + b) + 1; cout << a << endl; } return 0; }
[["+", 0, 14, 8, 9, 0, 52, 8, 9, 0, 46], ["-", 0, 14, 8, 9, 0, 52, 8, 9, 0, 46]]
1
49
#include <iostream> using namespace std; int main() { unsigned int a, b, c; // while (1) { cin >> a >> b; a += b; c = 0; do { a /= 10; c++; } while (a); cout << c << endl; // } return 0; }
#include <iostream> using namespace std; int main() { unsigned int a, b, c; while (cin >> a >> b) { a += b; c = 0; do { a /= 10; c++; } while (a); cout << c << 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
60
#include <iostream> using namespace std; int main() { char a, b, sum, cnt = 1; while (cin >> a >> b) { sum = a + b; while (1) { if (sum < 10) break; sum /= 10; cnt++; } cout << cnt << endl; cnt = 1; } return 0; }
#include <iostream> using namespace std; int main() { int a, b, sum, cnt = 1; while (cin >> a >> b) { sum = a + b; while (1) { if (sum < 10) break; sum /= 10; cnt++; } cout << cnt << endl; cnt = 1; } return 0; }
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
73
#include <cmath> #include <iostream> int main() { int a, b; while (std::cin >> a >> b) { std::cout << log10(a + b) + 1 << std::endl; } }
#include <cmath> #include <iostream> int main() { int a, b; while (std::cin >> a >> b) { std::cout << (int)log10(a + b) + 1 << std::endl; } }
[["+", 0, 16, 31, 16, 12, 16, 31, 74, 0, 24], ["+", 31, 16, 12, 16, 31, 74, 39, 77, 39, 40], ["+", 0, 16, 31, 16, 12, 16, 31, 74, 0, 25]]
1
44
#include <stdio.h> int main() { int a, b; while (scanf("%d", &a) != EOF) { scanf("%d", &b); a = a + b; b = 1; while (a / 10 > 0) { a = a / 10; b += 1; } printf("%d", b); } return 0; }
#include <stdio.h> int main() { int a, b; while (scanf("%d", &a) != EOF) { scanf("%d", &b); a = a + b; b = 1; while (a / 10 > 0) { a = a / 10; b += 1; } printf("%d\n", b); } return 0; }
[["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44]]
1
81
#include <iostream> using namespace std; int main() { int a, b; cin >> a >> b; int c = a + b; int i = 0; while (c != 0) { i++; c /= 10; } cout << i << endl; return 0; }
#include <iostream> using namespace std; int main() { int a, b; while (cin >> a >> b) { int c = a + b; int i = 0; while (c != 0) { i++; c /= 10; } cout << i << 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
59
#include <algorithm> #include <iostream> using namespace std; int main() { int a, b; cin >> a >> b; int c = a + b, count = 1; while (c >= 10) { c /= 10; count++; } cout << count << endl; return 0; }
#include <algorithm> #include <iostream> using namespace std; int main() { int a, b; while (cin >> a >> b) { int c = a + b, count = 1; while (c >= 10) { c /= 10; count++; } cout << count << 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
60
#include <cmath> #include <iostream> using namespace std; int main() { int a, b; while (cin >> a >> b) { a = log10(a + b); cout << a << endl; } return 0; }
#include <cmath> #include <iostream> using namespace std; int main() { int a, b; while (cin >> a >> b) { a = log10(a + b) + 1; cout << a << endl; } return 0; }
[["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 72], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 12, 13]]
1
47
#include <algorithm> #include <cmath> #include <functional> #include <iostream> #include <vector> int main() { int i; int j; while (std::cin >> i >> j) { int t = i * j; int y; for (y = 1; t / static_cast<int>(pow(10, y)) > 0; ++y) { } std::cout << y << std::endl; } return 0; }
#include <algorithm> #include <cmath> #include <functional> #include <iostream> #include <vector> int main() { int i; int j; while (std::cin >> i >> j) { int t = i + j; int y; for (y = 1; t / static_cast<int>(pow(10, y)) > 0; ++y) { } std::cout << y << std::endl; } return 0; }
[["-", 8, 9, 0, 43, 49, 50, 51, 16, 17, 48], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 17, 72]]
1
85
#include <cmath> #include <iostream> using namespace std; int main() { int a, b; while (cin >> a >> b) { cout << log10(a + b) + 1 << endl; } }
#include <cmath> #include <iostream> using namespace std; int main() { int a, b; while (cin >> a >> b) { cout << ((int)log10(a + b) + 1) << endl; } }
[["+", 0, 1, 0, 16, 31, 16, 12, 23, 0, 24], ["+", 31, 16, 12, 23, 0, 16, 31, 74, 0, 24], ["+", 12, 23, 0, 16, 31, 74, 39, 77, 39, 40], ["+", 31, 16, 12, 23, 0, 16, 31, 74, 0, 25], ["+", 0, 1, 0, 16, 31, 16, 12, 23, 0, 25]]
1
42
#include <stdio.h> int main() { int a, b, sum, cou; while (scanf("%d %d", &a, &b) != EOF) { // printf("%d%d",a,b);// sum = a + b; cou = 0; while (1) { if (sum < 10) break; sum = sum / 10; cou++; } printf("%d", cou + 1); } return 0; }
#include <stdio.h> int main() { int a, b, sum, cou; while (scanf("%d %d", &a, &b) != EOF) { // printf("%d%d",a,b);// sum = a + b; cou = 0; while (1) { if (sum < 10) break; sum = sum / 10; cou++; } printf("%d\n", cou + 1); } return 0; }
[["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44]]
1
84
#include <iostream> using namespace std; int main() { int a, b; while (cin >> a >> b) { int a, b; a += b; int ans; for (ans = 0; a != 0; ++ans) { a /= 10; } cout << ans << endl; } }
#include <iostream> using namespace std; int main() { int a, b; while (cin >> a >> b) { a += b; int ans; for (ans = 0; a != 0; ++ans) { a /= 10; } cout << ans << endl; } }
[["-", 8, 9, 0, 52, 8, 9, 0, 43, 39, 40], ["-", 8, 9, 0, 52, 8, 9, 0, 43, 0, 21], ["-", 8, 9, 0, 52, 8, 9, 0, 43, 49, 22], ["-", 8, 9, 0, 52, 8, 9, 0, 43, 0, 35], ["-", 0, 52, 8, 9, 0, 1, 0, 11, 31, 22]]
1
64
#include <iostream> #include <stdio.h> using namespace std; int main() { int a, b; int an[1000]; int con[1000]; int i = 0, j, k; while (cin >> a >> b) { an[i] = a + b; con[i] = 1; while (an[i] > 1) { an[i] /= 10; con[i]++; } i++; } for (j = 0; j < i; j++) { cout << con[j] << endl; } return 0; }
#include <iostream> #include <stdio.h> using namespace std; int main() { int a, b; int an[1000]; int con[1000]; int i = 0, j, k; while (cin >> a >> b) { an[i] = a + b; con[i] = 1; while (an[i] >= 10) { an[i] /= 10; con[i]++; } i++; } for (j = 0; j < i; j++) { cout << con[j] << endl; } return 0; }
[["-", 8, 9, 0, 52, 15, 339, 51, 16, 17, 47], ["-", 8, 9, 0, 52, 15, 339, 51, 16, 12, 13], ["+", 8, 9, 0, 52, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 52, 15, 339, 51, 16, 12, 13]]
1
120
#include <algorithm> #include <iostream> using namespace std; int main() { int a, b; cin >> a >> b; a += b; int dig_num = 1; while ((a /= 10) != 0) { ++dig_num; } cout << dig_num << "\n"; }
#include <algorithm> #include <iostream> using namespace std; int main() { int a, b; while (cin >> a >> b) { a += b; int dig_num = 1; while ((a /= 10) != 0) { ++dig_num; } cout << dig_num << "\n"; } }
[["+", 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
57
#include <cstdio> #include <iostream> using namespace std; int main() { int a, b, c, count = 0; while (cin >> a >> b) { c = a + b; while (c) { c = c / 10; count++; } cout << count << endl; } return 0; }
#include <cstdio> #include <iostream> using namespace std; int main() { int a, b, c, count = 0; while (cin >> a >> b) { c = a + b; while (c) { c = c / 10; count++; } cout << count << endl; count = 0; } 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]]
1
65
#include <stdio.h> int main() { long a, b, i, n; while (scanf("%ld", &a) != EOF) { scanf("%ld", &b); n = a + b; for (i = 1; i < 10; i++) { n = n / 10; if (n == 0) break; } printf("%ld\n", n); } }
#include <stdio.h> int main() { long a, b, i, n; while (scanf("%ld", &a) != EOF) { scanf("%ld", &b); n = a + b; for (i = 1; i < 10; i++) { n = n / 10; if (n == 0) break; } printf("%ld\n", i); } }
[["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22]]
1
88
#include <cmath> #include <iostream> using namespace std; int main() { int a, b, c; cin >> a >> b; c = a + b; cout << (int)log10(c) + 1 << endl; return 0; }
#include <cmath> #include <iostream> using namespace std; int main() { int a, b, c; while (cin >> a >> b) { c = a + b; cout << (int)log10(c) + 1 << 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
50
#include <algorithm> #include <iostream> #include <queue> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <utility> #include <vector> int n, a, b; using namespace std; int main() { std::ios::sync_with_stdio(false); while (cin >> a >> b) { n = a + b; int counter = 0; while (n) { n = n / 10; counter++; } cout << counter; } return 0; }
#include <algorithm> #include <iostream> #include <queue> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <utility> #include <vector> int n, a, b; using namespace std; int main() { std::ios::sync_with_stdio(false); while (cin >> a >> b) { n = a + b; int counter = 0; while (n) { n = n / 10; counter++; } cout << counter << "\n"; } return 0; }
[["+", 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]]
1
85
//------------- // include //------------- #include <algorithm> #include <cctype> #include <cmath> #include <cstdlib> #include <iostream> #include <list> #include <map> #include <string> #include <vector> using namespace std; //------------- // typedef //------------- typedef long long LL; typedef vector<int> VI; typedef string STR; typedef pair<int, int> PII; typedef vector<int, int> VII; typedef map<string, int> MSI; //------------- // utillty //------------- #define ALL(a) (a).begin(), (a).end() #define MK make_pair #define PB push_back #define SZ(a) int((a).size()) #define EACH(i, c) \ for (typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i) #define EXIST(s, e) ((s).find(e) != (s).end()) #define SORT(c) sort((c).begin(), (c).end()) #define COUT(a) cout << a << endl //------------- // repetition //------------- #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP(i, n) FOR(i, 0, n) //------------- // debug //------------- #define dump(x) cerr << #x << " = " << (x) << endl; #define dumpl(c) REP(i, SZ(c)) cerr << #c << i << "=" << (c[i]) << endl; #define debug(x) \ cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" \ << " " << __FILE__ << endl; const int MOD = 1000000007; int main() { int a, b; while (cin >> a >> b) { int x = a + b; int count = 0; while (x >= 10) { x /= 10; count++; } COUT(count); } #ifdef _DEBUG while (1) ; #endif // _DEBUG return 0; }
//------------- // include //------------- #include <algorithm> #include <cctype> #include <cmath> #include <cstdlib> #include <iostream> #include <list> #include <map> #include <string> #include <vector> using namespace std; //------------- // typedef //------------- typedef long long LL; typedef vector<int> VI; typedef string STR; typedef pair<int, int> PII; typedef vector<int, int> VII; typedef map<string, int> MSI; //------------- // utillty //------------- #define ALL(a) (a).begin(), (a).end() #define MK make_pair #define PB push_back #define SZ(a) int((a).size()) #define EACH(i, c) \ for (typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i) #define EXIST(s, e) ((s).find(e) != (s).end()) #define SORT(c) sort((c).begin(), (c).end()) #define COUT(a) cout << a << endl //------------- // repetition //------------- #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP(i, n) FOR(i, 0, n) //------------- // debug //------------- #define dump(x) cerr << #x << " = " << (x) << endl; #define dumpl(c) REP(i, SZ(c)) cerr << #c << i << "=" << (c[i]) << endl; #define debug(x) \ cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" \ << " " << __FILE__ << endl; const int MOD = 1000000007; int main() { int a, b; while (cin >> a >> b) { int x = a + b; int count = 1; while (x >= 10) { x = x / 10; count++; } COUT(count); } #ifdef _DEBUG while (1) ; #endif // _DEBUG return 0; }
[["-", 0, 52, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 52, 8, 9, 0, 43, 49, 50, 51, 13], ["-", 0, 52, 8, 9, 0, 1, 0, 11, 17, 90], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 17, 32], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 31, 22], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 85]]
1
235
#include <cmath> #include <iostream> using namespace std; int main() { int a, b, sum, ans; cin >> a >> b; sum = a + b; ans = (int)log10((double)sum) + 1; cout << ans << endl; return 0; }
#include <cmath> #include <iostream> using namespace std; int main() { int a, b, sum, ans; while (cin >> a >> b) { sum = a + b; ans = (int)log10((double)sum) + 1; cout << ans << 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
59
#include <iostream> using namespace std; int main() { int a, b, ans; while (cin >> a >> b) { ans = 0; a = a + b; while (a > 0, ans++, a /= 10) cout << ans << endl; } return 0; }
#include <iostream> using namespace std; int main() { int a, b, ans; while (cin >> a >> b) { ans = 0; a = a + b; while (a > 0) { ans++; a /= 10; } cout << ans << endl; } return 0; }
[["-", 8, 9, 0, 52, 15, 339, 51, 34, 0, 21], ["+", 0, 52, 8, 9, 0, 52, 15, 339, 0, 25], ["+", 0, 52, 8, 9, 0, 52, 8, 9, 0, 45], ["-", 0, 52, 15, 339, 51, 34, 12, 34, 0, 21], ["+", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35], ["-", 0, 52, 8, 9, 0, 52, 15, 339, 0, 25], ["+", 0, 52, 8, 9, 0, 52, 8, 9, 0, 46]]
1
61
#include <stdio.h> int main(void) { int a, b; while (scanf("%d %d", &a, &b) != EOF) { int sum = a + b; int digit = 1; while (sum > 10) { sum /= 10; digit++; } printf("%d\n", digit); } return 0; }
#include <stdio.h> int main(void) { int a, b; while (scanf("%d %d", &a, &b) != EOF) { int sum = a + b; int digit = 1; while (sum > 9) { sum /= 10; digit++; } printf("%d\n", digit); } return 0; }
[["-", 8, 9, 0, 52, 15, 339, 51, 16, 12, 13], ["+", 8, 9, 0, 52, 15, 339, 51, 16, 12, 13]]
1
73
#include <bits/stdc++.h> using namespace std; int main() { int a, b; cin >> a >> b; a += b; string c = to_string(a); cout << c.length() << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int a, b; while (cin >> a >> b) { a += b; string c = to_string(a); cout << c.length() << 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
45
#include <bits/stdc++.h> using namespace std; int main() { int a, b; cin >> a >> b; int s = a + b; int ans = 0; while (s) { ans++; s /= 10; } if (a + b == 0) cout << 1 << endl; else cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int a, b; while (cin >> a >> b) { int s = a + b; int ans = 0; while (s) { ans++; s /= 10; } if (a + b == 0) cout << 1 << endl; else cout << ans << 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
69
#include <stdio.h> int calc(int x, int y) { int a, t, k = 0; t = x + y; while (t) { t = t / 10; k += 1; } return k; } int main(void) { int a, b; while (scanf("%d %d", &a, &b) != EOF) { printf("%d", calc(a, b)); } }
#include <stdio.h> int calc(int x, int y) { int a, t, k = 0; t = x + y; while (t) { t = t / 10; k += 1; } return k; } int main(void) { int a, b; while (scanf("%d %d", &a, &b) != EOF) { printf("%d\n", calc(a, b)); } }
[["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44]]
1
92
#include <cmath> #include <iostream> #include <limits> int main(void) { int32_t first = 0; int32_t second = 0; while (std::cin >> first) { std::cin >> second; std::cout << static_cast<int32_t>(std::log10(first + second)) << std::endl; } return 0; }
#include <cmath> #include <iostream> #include <limits> int main(void) { int32_t first = 0; int32_t second = 0; while (std::cin >> first) { std::cin >> second; std::cout << static_cast<int32_t>(std::log10(first + second)) + 1 << std::endl; } return 0; }
[["+", 0, 1, 0, 16, 31, 16, 12, 16, 17, 72], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 12, 13]]
1
65
#include <stdio.h> int main() { int a, b; while (scanf("%d %d", &a, &b) != EOF) { int i = 0; int c = a + b; while (c / 10 != 0) { i++; c = c / 10; } printf("%d\n", i); } return 0; }
#include <stdio.h> int main() { int a, b; while (scanf("%d %d", &a, &b) != EOF) { int i = 0; int c = a + b; while (c != 0) { i++; c = c / 10; } printf("%d\n", i); } return 0; }
[["-", 0, 52, 15, 339, 51, 16, 31, 16, 17, 85], ["-", 0, 52, 15, 339, 51, 16, 31, 16, 12, 13]]
1
76
#include <iostream> #include <string> using namespace std; int main() { int a, b; cin >> a >> b; cout << to_string(a + b).length() << endl; }
#include <iostream> #include <string> using namespace std; int main() { int a, b; while (cin >> a >> b) { cout << to_string(a + b).length() << 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
40
#include <iostream> #include <sstream> #include <string> using namespace std; int main() { int a, b; while (cin >> a) { cin >> b; int sum = a + b; stringstream ss; ss << sum; string str(ss.str()); cout << str.size(); } }
#include <iostream> #include <sstream> #include <string> using namespace std; int main() { int a, b; while (cin >> a) { cin >> b; int sum = a + b; stringstream ss; ss << sum; string str(ss.str()); cout << str.size() << endl; } }
[["+", 0, 52, 8, 9, 0, 1, 0, 16, 17, 151], ["+", 0, 52, 8, 9, 0, 1, 0, 16, 12, 22]]
1
65
#include <bits/stdc++.h> using namespace std; typedef long int lint; typedef long long int llint; typedef pair<int, int> pii; typedef pair<int, string> pis; typedef pair<long, long> pll; #define EACH(i, c) \ for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i) #define ALL(c) (c).begin(), (c).end() #define FOR(i, s, e) for (int i = (s); i < (int)(e); ++i) #define REP(i, n) FOR(i, 0, n) #define endl '\n' #define mod 1000000007 #define INF 100000000 #define fk first #define sv second const int dx[] = {1, 0, -1, 0, 1, 1, -1, -1}, dy[] = {0, 1, 0, -1, 1, -1, 1, -1}; template <typename T> void print(const std::vector<T> &v, char sep = ' ') { for (int i = 0; i < (int)v.size(); i++) { if (i != 0) cout << sep; cout << v[i]; } cout << endl; } int main() { cin.tie(0); ios::sync_with_stdio(false); int a, b; cin >> a >> b; int res = a + b, ct = 0; while (res != 0) { ct++; res /= 10; } cout << ct << endl; }
#include <bits/stdc++.h> using namespace std; typedef long int lint; typedef long long int llint; typedef pair<int, int> pii; typedef pair<int, string> pis; typedef pair<long, long> pll; #define EACH(i, c) \ for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i) #define ALL(c) (c).begin(), (c).end() #define FOR(i, s, e) for (int i = (s); i < (int)(e); ++i) #define REP(i, n) FOR(i, 0, n) #define endl '\n' #define mod 1000000007 #define INF 100000000 #define fk first #define sv second const int dx[] = {1, 0, -1, 0, 1, 1, -1, -1}, dy[] = {0, 1, 0, -1, 1, -1, 1, -1}; template <typename T> void print(const std::vector<T> &v, char sep = ' ') { for (int i = 0; i < (int)v.size(); i++) { if (i != 0) cout << sep; cout << v[i]; } cout << endl; } int main() { cin.tie(0); ios::sync_with_stdio(false); int a, b; while (cin >> a >> b) { int res = a + b, ct = 0; while (res != 0) { ct++; res /= 10; } cout << ct << 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
272
#include <cmath> #include <iostream> #include <sstream> using namespace std; int main() { string s; int a, b, c; while (getline(cin, s)) { int SpaceInd = s.find_first_of(" "); std::istringstream iss1(s.substr(0, SpaceInd)); iss1 >> a; std::istringstream iss2(s.substr(SpaceInd + 1)); iss2 >> b; cout << (int)log10(a + b) << endl; } return 0; }
#include <cmath> #include <iostream> #include <sstream> using namespace std; int main() { string s; int a, b, c; while (getline(cin, s)) { int SpaceInd = s.find_first_of(" "); std::istringstream iss1(s.substr(0, SpaceInd)); iss1 >> a; std::istringstream iss2(s.substr(SpaceInd + 1)); iss2 >> b; cout << (int)log10(a + b) + 1 << endl; } return 0; }
[["+", 0, 1, 0, 16, 31, 16, 12, 16, 17, 72], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 12, 13]]
1
104
#include <bits/stdc++.h> using namespace std; int main() { int a, b, c, ans = 1; while (cin >> a >> b) { c = a + b; while (c >= 10) { ++ans; c /= 10; } cout << ans << "\n"; } }
#include <bits/stdc++.h> using namespace std; int main() { int a, b, c, ans = 1; while (cin >> a >> b) { c = a + b; ans = 1; while (c >= 10) { ++ans; c /= 10; } cout << ans << "\n"; } }
[["+", 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]]
1
62
array = [] for i in range(10): line = int(input()) array += [line] result = array.sort()[::-1] print(result[0]) print(result[1]) print(result[2])
# coding: utf-8 # Here your code ! array = [] for i in range(10): line = int(input()) array += [line] result = sorted(array)[::-1] print(result[0]) print(result[1]) print(result[2])
[["-", 0, 662, 12, 206, 51, 652, 63, 319, 500, 22], ["-", 0, 662, 12, 206, 51, 652, 63, 319, 0, 131], ["-", 0, 662, 12, 206, 51, 652, 63, 319, 319, 22], ["+", 0, 1, 0, 662, 12, 206, 51, 652, 63, 22], ["+", 0, 662, 12, 206, 51, 652, 3, 4, 0, 22]]
5
59
def main(): a = [] for i in range(10): a.append(int(input())) a.sort() a.reverse() for i in range(3): print(i) if __name__ == '__main__': main()
def main(): a = [] for i in range(10): a.append(int(input())) a.sort() a.reverse() for i in range(3): print(a[i]) if __name__ == '__main__': main()
[["+", 0, 1, 0, 652, 3, 4, 0, 206, 51, 22], ["+", 0, 1, 0, 652, 3, 4, 0, 206, 0, 70], ["+", 0, 1, 0, 652, 3, 4, 0, 206, 0, 73]]
5
60
hight = [] for i in range(10): hight.append(int(input())) hight.sort() print(hight[0]) print(hight[1]) print(hight[2])
hight = [] for i in range(10): hight.append(int(input())) hight.sort(reverse=True) print(hight[0]) print(hight[1]) print(hight[2])
[["+", 0, 1, 0, 652, 3, 4, 0, 653, 141, 22], ["+", 0, 1, 0, 652, 3, 4, 0, 653, 0, 32], ["+", 0, 1, 0, 652, 3, 4, 0, 653, 51, 146]]
5
49
l = [] for i in range(10): l.append(int(input())) l.sort() for i in range(3): print(l[-1 * [i+1]])
l = [] for i in range(10): l.append(int(input())) l.sort() for i in range(3): print(l[-1 * (i+1)])
[["-", 3, 4, 0, 206, 206, 657, 12, 634, 0, 70], ["+", 3, 4, 0, 206, 206, 657, 12, 23, 0, 24], ["-", 3, 4, 0, 206, 206, 657, 12, 634, 0, 73], ["+", 3, 4, 0, 206, 206, 657, 12, 23, 0, 25]]
5
50
# -*- coding:utf-8 -*- first = 0 second = 0 third = 0 i = 0 for i in range(0,9): line = int(eval(input())) if first < int(line): third = second second = first first = int(line) elif second < int(line): third = second second = int(line) elif third < int(line): third = int(line) print(first) print(second) print(third)
# -*- coding:utf-8 -*- first = 0 second = 0 third = 0 i = 0 for i in range(0,10): line = int(input()) if first < int(line): third = second second = first first = int(line) elif second < int(line): third = second second = int(line) elif third < int(line): third = int(line) print(first) print(second) print(third)
[["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["-", 0, 662, 12, 652, 3, 4, 0, 652, 63, 22], ["-", 12, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["-", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
97
n = 0 list = [] while n < 10: x = input() list.append(x) n += 1 list.sort() print(list[9]) print(list[8]) print(list[7])
n = 0 list = [] while n < 10: x = int(input()) list.append(x) n += 1 list.sort() print(list[9]) print(list[8]) print(list[7])
[["+", 8, 196, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
52
s = sorted([input() for i in range(10)]) for i in range(3): print(s[9-i])
# coding: utf-8 #Name: List of Top 3 Hills #Level: 1 #Category: ???????????? #Note: s = sorted([int(input()) for i in range(10)]) for i in range(3): print(s[9-i])
[["+", 12, 652, 3, 4, 0, 658, 8, 652, 63, 22], ["+", 3, 4, 0, 658, 8, 652, 3, 4, 0, 24], ["+", 8, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
34
lis=[] for i in range(10): lis.append(input()) for i in sorted(lis,reverse=True)[:3]: print(i)
lis=[] for i in range(10): lis.append(int(input())) for i in sorted(lis,reverse=True)[:3]: print(i)
[["+", 0, 1, 0, 652, 3, 4, 0, 652, 63, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
40
ans=[] for i in range (0,10): ans.append(input()) ans.sort(reverse=True) for i in range (0,3): print(ans[i])
ans=[] for i in range (0,10): ans.append(int(input())) ans.sort(reverse=True) for i in range (0,3): print(ans[i])
[["+", 0, 1, 0, 652, 3, 4, 0, 652, 63, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
47
mountain=[] for i in range(10): mountain[i]=int(input()) mountain.sort() mountain.reverse() for i in range(3): print(mountain[i])
mountain=[] for i in range(10): mountain.append(int(input())) mountain.sort() mountain.reverse() for i in range(3): print(mountain[i])
[["-", 8, 196, 0, 1, 0, 662, 31, 206, 0, 70], ["-", 8, 196, 0, 1, 0, 662, 31, 206, 206, 22], ["-", 8, 196, 0, 1, 0, 662, 31, 206, 0, 73], ["-", 0, 7, 8, 196, 0, 1, 0, 662, 0, 32], ["+", 8, 196, 0, 1, 0, 652, 63, 319, 0, 131], ["+", 8, 196, 0, 1, 0, 652, 63, 319, 319, 22], ["+", 8, 196, 0, 1, 0, 652, 3, 4, 0, 24], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
48
a = [] for i in range(10): a.append(int(input())) a.sort print(a[9]) print(a[8]) print(a[7])
a = [] for i in range(10): a.append(int(input())) a.sort() print(a[9]) print(a[8]) print(a[7])
[["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]]
5
47
l=[] for i in range(10): l.append(int(input())) l.sort().reverse() print(l[0]) print(l[1]) print(l[2])
l=[] for i in range(10): l.append(int(input())) l.sort(reverse=True) print(l[0]) print(l[1]) print(l[2])
[["-", 0, 652, 63, 319, 500, 652, 3, 4, 0, 25], ["-", 0, 656, 0, 1, 0, 652, 63, 319, 0, 131], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["+", 0, 1, 0, 652, 3, 4, 0, 653, 0, 32], ["+", 0, 1, 0, 652, 3, 4, 0, 653, 51, 146]]
5
53
import sys heights = [] for height in sys.stdin: heights.append(int(height.rstrip())) heights.reverse() for i in range(3): print(heights[i])
import sys heights = [] for height in sys.stdin: heights.append(int(height.rstrip())) heights.sort() heights.reverse() for i in range(3): print(heights[i])
[["+", 0, 656, 0, 1, 0, 652, 63, 319, 319, 22], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25], ["+", 0, 656, 0, 1, 0, 652, 63, 319, 500, 22], ["+", 0, 656, 0, 1, 0, 652, 63, 319, 0, 131]]
5
46
heights = list() for i in range(10): heights.append(int(input())) for height in reversed(sorted(heights))[:3]: print(height)
heights = list() for i in range(10): heights.append(int(input())) for height in list(reversed(sorted(heights)))[:3]: print(height)
[["+", 0, 656, 0, 7, 12, 206, 51, 652, 63, 22], ["+", 0, 7, 12, 206, 51, 652, 3, 4, 0, 24], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
43
#! /usr/bin/env python # -*- coding: utf-8 -*- def main(): mountains = [] for i in range(3): mountains.append(int(input())) mountains = sorted(mountains, reverse = True) for i in range(3): print(mountains[i]) if __name__ == '__main__': main()
#! /usr/bin/env python # -*- coding: utf-8 -*- def main(): mountains = [] for i in range(10): mountains.append(int(input())) mountains = sorted(mountains, reverse = True) for i in range(3): print(mountains[i]) if __name__ == '__main__': main()
[["-", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612]]
5
65
def quicksort(array): if len(array) < 2: return array else: pivot = array[0] less = [i for i in array[1:] if i <= pivot] greater = [i for i in array[1:] if i > pivot] return quicksort(less) + [pivot] + quicksort(greater) array = [] for _ in range(10): array.append(int(input('input integer'))) sorted_array = quicksort(array) for i in range(3): print(sorted_array[9-i])
def quicksort(array): if len(array) < 2: return array else: pivot = array[0] less = [i for i in array[1:] if i <= pivot] greater = [i for i in array[1:] if i > pivot] return quicksort(less) + [pivot] + quicksort(greater) array = [] for _ in range(10): array.append(int(input())) sorted_array = quicksort(array) for i in range(3): print(sorted_array[9-i])
[["-", 3, 4, 0, 652, 3, 4, 0, 557, 0, 654], ["-", 3, 4, 0, 652, 3, 4, 0, 557, 0, 6], ["-", 3, 4, 0, 652, 3, 4, 0, 557, 0, 655]]
5
121
# coding: utf-8 list = [] for i in range(10): list.append(int(input())) slist = sorted(list) for i in range(3): print(slist[i+1])
# coding: utf-8 list = [] for i in range(10): list.append(int(input())) slist = sorted(list) for i in range(3): print(slist[9-i])
[["+", 0, 652, 3, 4, 0, 206, 206, 657, 31, 612], ["+", 0, 652, 3, 4, 0, 206, 206, 657, 17, 33], ["-", 0, 652, 3, 4, 0, 206, 206, 657, 17, 72], ["-", 0, 652, 3, 4, 0, 206, 206, 657, 12, 612]]
5
47
a=[] for i in range(10): tmp = input() a.append(tmp) b=sorted(a, reverse=True) print(b[0]) print(b[1]) print(b[2])
#a=list(map(int,input().split())) a=[] for i in range(10): tmp = int(input()) a.append(tmp) b=sorted(a, reverse=True) print(b[0]) print(b[1]) print(b[2])
[["+", 8, 196, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
54
#coding:utf-8 l = sorted([int(input()) for i in range(10)]) for i in range(3): print(l[7+i])
#coding:utf-8 l = sorted([int(input()) for i in range(10)]) for i in range(3): print(l[9-i])
[["-", 0, 652, 3, 4, 0, 206, 206, 657, 31, 612], ["-", 0, 652, 3, 4, 0, 206, 206, 657, 17, 72], ["+", 0, 652, 3, 4, 0, 206, 206, 657, 31, 612], ["+", 0, 652, 3, 4, 0, 206, 206, 657, 17, 33]]
5
38
list=list() for i in range(10): t=input() list.append(int(t)) list.sort() for i in range(3): print(list[i])
list=list() for i in range(10): t=input() list.append(int(t)) list.sort(reverse=True) for i in range(3): print(list[i])
[["+", 0, 1, 0, 652, 3, 4, 0, 653, 141, 22], ["+", 0, 1, 0, 652, 3, 4, 0, 653, 0, 32], ["+", 0, 1, 0, 652, 3, 4, 0, 653, 51, 146]]
5
47