submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s526220027
p00002
C++
#include <stdio.h> int main(){ int a,b; while(scanf("%d %d ",&a,&b)){ a+=b; b=0; while(a>0){ b++; a/=10 } printf("%d\n",b); } return 0; }
a.cc: In function 'int main()': a.cc:10:8: error: expected ';' before '}' token 10 | a/=10 | ^ | ; 11 | } | ~
s893150230
p00002
C++
#include <stdio.h> int main(){ int a,b; while(scanf("%d %d ",&a,&b)){ a+=b; b=0; while(a>0){ b++; a/=10 } printf("%d\n",b?b:1); } return 0; }
a.cc: In function 'int main()': a.cc:10:8: error: expected ';' before '}' token 10 | a/=10 | ^ | ; 11 | } | ~
s772196244
p00002
C++
#include <iostream> #include <string> #include <sstream> using namespace std; int main() { int a, b, cnt; string s; getline(cin, s, ' '); a = stoi(s); getline(cin, s); b = stoi(s); a += b; cnt = 0; if (c == 0) { cnt = 1; } else { while (c) { cnt++; c /= 10; } } cout << cnt << endl; }
a.cc: In function 'int main()': a.cc:14:7: error: 'c' was not declared in this scope 14 | if (c == 0) { | ^
s140275878
p00002
C++
#include <iostream> #include <cmath> int main() { int a, b; while (cin >> a >> b) { a = log10(a + b); cout << a << endl; } return 0; }
a.cc: In function 'int main()': a.cc:5:10: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 5 | while (cin >> a >> b) { | ^~~ | std::cin In file included from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:7:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 7 | cout << a << endl; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:7:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 7 | cout << a << endl; | ^~~~ | std::endl In file included from /usr/include/c++/14/iostream:41: /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
s764097178
p00002
C++
#include<bits\stdc++.h> using namespace std; int main(){ int a,b; while(cin>>a>>b){ int sum=a+b,cnt=0; while(sum) sum/=10,cnt++; cout<<cnt<<endl; } return 0; }
a.cc:1:9: fatal error: bits\stdc++.h: No such file or directory 1 | #include<bits\stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s203358745
p00002
C++
#include <iostream> using namespace std; int main(){ int a, b, c, i; int number = 1; cin >> a >> b; c = a+b; for(i=0; i++){ if(c/10 != 0){ number = number + 1; } else{ break; } cout << number << endl; } }
a.cc: In function 'int main()': a.cc:12:21: error: expected ';' before ')' token 12 | for(i=0; i++){ | ^ | ;
s452283736
p00002
C++
#include <string> #include <iostream> #include <sstream> using namespace std; int main(){ int a, b; while(cin >> a >> b){ printf("%d",(int)log10((double)a+b) + 1); } }
a.cc: In function 'int main()': a.cc:9:34: error: 'log10' was not declared in this scope 9 | printf("%d",(int)log10((double)a+b) + 1); | ^~~~~
s440656921
p00002
C++
#include <string> #include <iostream> #include <sstream> using namespace std; int main(){ int a, b; while(cin >> a >> b){ cout << (int)log10((double)a+b) + 1 << endl; } }
a.cc: In function 'int main()': a.cc:9:30: error: 'log10' was not declared in this scope 9 | cout << (int)log10((double)a+b) + 1 << endl; | ^~~~~
s842857146
p00002
C++
#include <string> #include <iostream> #include <sstream> using namespace std; int main(){ int a, b; while(cin >> a >> b){ cout << log10(a+b) + 1 << endl; } }
a.cc: In function 'int main()': a.cc:9:25: error: 'log10' was not declared in this scope 9 | cout << log10(a+b) + 1 << endl; | ^~~~~
s656715499
p00002
C++
#include<stdio.h> #include<stdlib.h> #include<iostream> #include<string> #include<vector> #include<math.h> #include<queue> #include <algorithm> #include<functional> #include<cstdlib> #include<cmath> #define REP(i, n) for(int i = 0;i < n;i++) #define REPR(i, n) for(int i = n;i >= 0;i--) #define FOR(i, m, n) for(int i = m;i < n;i++) #define FORR(i, m, n) for(int i = m;i >= n;i--) #define CI cin >> #define CO cout << #define E << endl; using namespace std; typedef pair<int, int> P; typedef pair<long, long> LP; typedef pair<int, P> PP; typedef pair<long, LP> LPP; int dy[] = { 0, 0, 1, -1, 0 }; int dx[] = { 1, -1, 0, 0, 0 }; int A = 0, B = 0, K = 0, T = 0, W = 0, N = 0, H = 0; int n = 0; double L = 0; double S = 0; double ar = 0, br = 0, cr = 0; int answer = 0; string C; string sA, strB; vector<vector<char>> map; vector<double> num; vector<string> str; int sum = 0; vector<int> value; vector<int> weight; int dp[110][10010]; int data_[210][2] = {-2}; void input() { int i = 0; while (scanf_s("%d%d",&data_[i][0],&data_[i][1]) != EOF) { i++; } return; } int main(void) { input(); int i = 0; int sum = 0; int numb = 0; while (true) { sum = data_[i][0] + data_[i][1]; while (sum != 0) { numb++; sum /= 10; } if (data_[i + 1][0] == -2) { break; } } CO numb E return 0; }
a.cc: In function 'void input()': a.cc:58:16: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 58 | while (scanf_s("%d%d",&data_[i][0],&data_[i][1]) != EOF) { | ^~~~~~~ | scanf
s223438249
p00002
C++
#include<stdio.h> #include<stdlib.h> #include<iostream> #include<string> #include<vector> #include<math.h> #include<queue> #include <algorithm> #include<functional> #include<cstdlib> #include<cmath> #define REP(i, n) for(int i = 0;i < n;i++) #define REPR(i, n) for(int i = n;i >= 0;i--) #define FOR(i, m, n) for(int i = m;i < n;i++) #define FORR(i, m, n) for(int i = m;i >= n;i--) #define CI cin >> #define CO cout << #define E << endl; using namespace std; typedef pair<int, int> P; typedef pair<long, long> LP; typedef pair<int, P> PP; typedef pair<long, LP> LPP; int dy[] = { 0, 0, 1, -1, 0 }; int dx[] = { 1, -1, 0, 0, 0 }; int A = 0, B = 0, K = 0, T = 0, W = 0, N = 0, H = 0; int n = 0; double L = 0; double S = 0; double ar = 0, br = 0, cr = 0; int answer = 0; string C; string sA, strB; vector<vector<char>> map; vector<double> num; vector<string> str; int sum = 0; vector<int> value; vector<int> weight; int dp[110][10010]; int data_[210][2] = {-2}; void input() { int i = 0; while (scanf_s("%d%d",&data_[i][0],&data_[i][1]) != EOF) { i++; } return; } int main(void) { input(); int i = 0; int sum = 0; int numb = 0; while (true) { sum = data_[i][0] + data_[i][1]; while (sum != 0) { numb++; sum /= 10; } if (data_[i + 1][0] == -2) { break; } } CO numb E return 0; }
a.cc: In function 'void input()': a.cc:58:16: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 58 | while (scanf_s("%d%d",&data_[i][0],&data_[i][1]) != EOF) { | ^~~~~~~ | scanf
s145963278
p00002
C++
#include<stdio.h> #include<stdlib.h> #include<iostream> #include<string> #include<vector> #include<math.h> #include<queue> #include <algorithm> #include<functional> #include<cstdlib> #include<cmath> #define REP(i, n) for(int i = 0;i < n;i++) #define REPR(i, n) for(int i = n;i >= 0;i--) #define FOR(i, m, n) for(int i = m;i < n;i++) #define FORR(i, m, n) for(int i = m;i >= n;i--) #define CI cin >> #define CO cout << #define E << endl; using namespace std; typedef pair<int, int> P; typedef pair<long, long> LP; typedef pair<int, P> PP; typedef pair<long, LP> LPP; int dy[] = { 0, 0, 1, -1, 0 }; int dx[] = { 1, -1, 0, 0, 0 }; int A = 0, B = 0, K = 0, T = 0, W = 0, N = 0, H = 0; int n = 0; double L = 0; double S = 0; double ar = 0, br = 0, cr = 0; int answer = 0; string C; string sA, strB; vector<vector<char>> map; vector<double> num; vector<string> str; int sum = 0; vector<int> value; vector<int> weight; int dp[110][10010]; int data_[210][2] = {-2}; void input() { int i = 0; while (CI data_[i][0] >> data_[i][1] != EOF) { i++; } return; } int main(void) { input(); int i = 0; int sum = 0; int numb = 0; while (true) { sum = data_[i][0] + data_[i][1]; while (sum != 0) { numb++; sum /= 10; } if (data_[i + 1][0] == -2) { break; } } CO numb E return 0; }
a.cc: In function 'void input()': a.cc:58:46: error: no match for 'operator!=' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'int') 58 | while (CI data_[i][0] >> data_[i][1] != EOF) { | ^~ a.cc:58:46: note: candidate: 'operator!=(int, int)' (built-in) 58 | while (CI data_[i][0] >> data_[i][1] != EOF) { | ^ a.cc:58:46: note: no known conversion for argument 1 from 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} to 'int' In file included from /usr/include/c++/14/iosfwd:42, from /usr/include/c++/14/ios:40, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:3: /usr/include/c++/14/bits/postypes.h:197:5: note: candidate: 'template<class _StateT> bool std::operator!=(const fpos<_StateT>&, const fpos<_StateT>&)' 197 | operator!=(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/postypes.h:197:5: note: template argument deduction/substitution failed: In file included from a.cc:1: a.cc:58:49: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::fpos<_StateT>' 58 | while (CI data_[i][0] >> data_[i][1] != EOF) { | ^~~ In file included from /usr/include/c++/14/string:43, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44: /usr/include/c++/14/bits/allocator.h:243:5: note: candidate: 'template<class _T1, class _T2> bool std::operator!=(const allocator<_CharT>&, const allocator<_T2>&)' 243 | operator!=(const allocator<_T1>&, const allocator<_T2>&) | ^~~~~~~~ /usr/include/c++/14/bits/allocator.h:243:5: note: template argument deduction/substitution failed: a.cc:58:49: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::allocator<_CharT>' 58 | while (CI data_[i][0] >> data_[i][1] != EOF) { | ^~~ In file included from /usr/include/c++/14/string:48: /usr/include/c++/14/bits/stl_iterator.h:455:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 455 | operator!=(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:455:5: note: template argument deduction/substitution failed: a.cc:58:49: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 58 | while (CI data_[i][0] >> data_[i][1] != EOF) { | ^~~ /usr/include/c++/14/bits/stl_iterator.h:500:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 500 | operator!=(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:500:5: note: template argument deduction/substitution failed: a.cc:58:49: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 58 | while (CI data_[i][0] >> data_[i][1] != EOF) { | ^~~ /usr/include/c++/14/bits/stl_iterator.h:1686:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1686 | operator!=(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1686:5: note: template argument deduction/substitution failed: a.cc:58:49: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 58 | while (CI data_[i][0] >> data_[i][1] != EOF) { | ^~~ /usr/include/c++/14/bits/stl_iterator.h:1753:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1753 | operator!=(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1753:5: note: template argument deduction/substitution failed: a.cc:58:49: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 58 | while (CI data_[i][0] >> data_[i][1] != EOF) { | ^~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/string:51: /usr/include/c++/14/bits/stl_pair.h:1052:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator!=(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1052 | operator!=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1052:5: note: template argument deduction/substitution failed: a.cc:58:49: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::pair<_T1, _T2>' 58 | while (CI data_[i][0] >> data_[i][1] != EOF) { | ^~~ In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54: /usr/include/c++/14/string_view:651:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 651 | operator!=(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:651:5: note: template argument deduction/substitution failed: a.cc:58:49: note: 'std::basic_istream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 58 | while (CI data_[i][0] >> data_[i][1] != EOF) { | ^~~ /usr/include/c++/14/string_view:658:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)' 658 | operator!=(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:658:5: note: template argument deduction/substitution failed: a.cc:58:49: note: 'std::basic_istream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 58 | while (CI data_[i][0] >> data_[i][1] != EOF) { | ^~~ /usr/include/c++/14/string_view:666:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)' 666 | operator!=(__type_identity_t<basic_string_view<_CharT, _Traits>> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:666:5: note: template argument deduction/substitution failed: a.cc:58:49: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int' 58 | while (CI data_[i][0] >> data_[i][1] != EOF) { | ^~~ /usr/include/c++/14/bits/basic_string.h:3833:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3833 | operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3833:5: note: template argument deduction/substitution failed: a.cc:58:49: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 58 | while (CI data_[i][0] >> data_[i][1] != EOF) { | ^~~ /usr/include/c++/14/bits/basic_string.h:3847:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3847 | operator!=(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3847:5: note: template argument deduction/substitution failed: a.cc:58:49: note: mismatched types 'const _CharT*' and 'std::basic_istream<char>' 58 | while (CI data_[i][0] >> data_[i][1] != EOF) { | ^~~ /usr/include/c++/14/bits/basic_string.h:3860:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 3860 | operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3860:5: note: template argument deduction/substitution failed: a.cc:58:49: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 58 | while (CI data_[i][0] >> data_[i][1] != EOF) { | ^~~ In file included from /usr/include/c++/14/bits/memory_resource.h:47, from /usr/include/c++/14/string:68: /usr/include/c++/14/tuple:2613:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator!=(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)'
s342819498
p00002
C++
#include<stdio.h> #include<stdlib.h> #include<iostream> #include<string> #include<vector> #include<math.h> #include<queue> #include <algorithm> #include<functional> #include<cstdlib> #include<cmath> #define REP(i, n) for(int i = 0;i < n;i++) #define REPR(i, n) for(int i = n;i >= 0;i--) #define FOR(i, m, n) for(int i = m;i < n;i++) #define FORR(i, m, n) for(int i = m;i >= n;i--) #define CI cin >> #define CO cout << #define E << endl; using namespace std; typedef pair<int, int> P; typedef pair<long, long> LP; typedef pair<int, P> PP; typedef pair<long, LP> LPP; int dy[] = { 0, 0, 1, -1, 0 }; int dx[] = { 1, -1, 0, 0, 0 }; int A = 0, B = 0, K = 0, T = 0, W = 0, N = 0, H = 0; int n = 0; double L = 0; double S = 0; double ar = 0, br = 0, cr = 0; int answer = 0; string C; string sA, strB; vector<vector<char>> map; vector<double> num; vector<string> str; int sum = 0; vector<int> value; vector<int> weight; int dp[110][10010]; int data_[210][2] = {-2}; void input() { int i = 0; return; } int main(void) { input(); int i = 0; int sum = 0; int numb = 0; int a = 0; int b = 0; while ((scanf_s("%d%d",&a,&b)) != EOF) { sum = a + b; while (sum != 0) { numb++; sum /= 10; } CO numb E numb = 0; } return 0; }
a.cc: In function 'int main()': a.cc:72:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 72 | while ((scanf_s("%d%d",&a,&b)) != EOF) { | ^~~~~~~ | scanf
s981082067
p00002
C++
#include<iostream> using namespace std; int main(){ int x[3],y[3],sum; int digit[3] = {0}; for(i=0; i<3; ++i) cin >> x[i] >> y[i]; for(i=0; i<3; ++i){ sum = x[i] + y[i]; while(sum != 0){ sum = sum / 10; ++digit[i]; } } for(i=0; i<3; ++i) cout << digit[i] << "\n"; return 0; }
a.cc: In function 'int main()': a.cc:9:7: error: 'i' was not declared in this scope 9 | for(i=0; i<3; ++i) | ^ a.cc:12:7: error: 'i' was not declared in this scope 12 | for(i=0; i<3; ++i){ | ^ a.cc:21:7: error: 'i' was not declared in this scope 21 | for(i=0; i<3; ++i) | ^
s142304595
p00002
C++
#include<stdio.h> int main(){ int a,b,sum,i; while(scant("%d %d",a,b)!=-1){ sum=a+b; for(i=0;sum!=0;i++){ sum=sum/10; } printf("%d\n",i); } return 0; }
a.cc: In function 'int main()': a.cc:5:11: error: 'scant' was not declared in this scope; did you mean 'scanf'? 5 | while(scant("%d %d",a,b)!=-1){ | ^~~~~ | scanf
s229039302
p00002
C++
using System; using System.Linq; public class Program { public static void Main() { string buf; while(!string.IsNullOrEmpty(buf = Console.ReadLine())) { Console.WriteLine(buf.Split().Select(int.Parse).Sum().ToString().Length); } } }
a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System; | ^~~~~~ a.cc:2:7: error: expected nested-name-specifier before 'System' 2 | using System.Linq; | ^~~~~~ a.cc:3:1: error: expected unqualified-id before 'public' 3 | public class Program { | ^~~~~~
s634647501
p00002
C++
#include<stdio.h> int main(void) { int a, b, d = 1,l=0; while (l<200) { scanf("%d %d", &a, &b); for (size_t i = 10; ; i *= 10) { if ((a + b) / i == 0)break; d++; } printf("%d\n", d); a = 0; b = 0; d = 1; l++ } return 0; }
a.cc: In function 'int main()': a.cc:14:20: error: expected ';' before '}' token 14 | l++ | ^ | ; 15 | } | ~
s571159465
p00002
C++
#include<iostream> using namespace std; int main(){ int a,b,c; int d=0; cin >> a >> b; int c=a+b; while(c!=0){ c=c/10; d=d+1; } cout << d << endl; }
a.cc: In function 'int main()': a.cc:7:7: error: redeclaration of 'int c' 7 | int c=a+b; | ^ a.cc:4:11: note: 'int c' previously declared here 4 | int a,b,c; | ^
s765066753
p00002
C++
#include<iostream> using namespace std; int main(){ int a,b; int c=a+b; int d=0 cin >> a >> b; while(c!=0){ c=c/10; d=d+1; } cout << d << endl; }
a.cc: In function 'int main()': a.cc:7:3: error: expected ',' or ';' before 'cin' 7 | cin >> a >> b; | ^~~
s411190341
p00002
C++
#include<iostream> using namespace std; int main(){ int a,b,i; int c=a+b; int d=0; int n; 1<=n<=200; for(int i=i;i<=n;i++) cin >> a >> b; while(c!=0){ c=c/10; d=d+1; } cout << d << endl; } }
a.cc:17:1: error: expected declaration before '}' token 17 | } | ^
s402232710
p00002
C++
#include <iostream> using namespace std; int main() { int sum, a, b, i,t; for(t = 0 ; t < 3 ; t++) { cin >> a >> b; sum = a + b; i = 1; while(1) { sum = sum / 10; if(sum == 0) break; i++ } cout << i << endl; } return 0; }
a.cc: In function 'int main()': a.cc:21:14: error: expected ';' before '}' token 21 | i++ | ^ | ; 22 | } | ~
s852268830
p00002
C++
#include <iostream> #include <stdio.h> #include <math.h> using namespace std; int main(void) { long long int a, b; int ans[200],cou = 0; while ((scanf_s("%lld %lld",&a,&b)) != EOF) { for (int i = 1, j = 1; i <= 7; i++, j *= 10) { if (a + b / j <= 0) { ans[cou] = i; cou++; break; } } } }
a.cc: In function 'int main()': a.cc:9:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 9 | while ((scanf_s("%lld %lld",&a,&b)) != EOF) { | ^~~~~~~ | scanf
s738954816
p00002
C++
#include<stdio.h> int main(){ int i,j; int data[6]; for(i=0;i<6;i++){ scanf("%d",&data[i]); } data[0]=data[0]+data[1]; data[1]=data[2]+data[3]; data[2]=data[4]+data[5]; for(i=0;i<3;i++){ for(j=0;j<10;j++){ if(data[i]<10){ data[i+3]=j; }else{ data[i]=(int)data[i]/10; } } getchar();
a.cc: In function 'int main()': a.cc:25:19: error: expected '}' at end of input 25 | getchar(); | ^ a.cc:15:25: note: to match this '{' 15 | for(i=0;i<3;i++){ | ^ a.cc:25:19: error: expected '}' at end of input 25 | getchar(); | ^ a.cc:3:11: note: to match this '{' 3 | int main(){ | ^
s912280015
p00002
C++
#include<stdio.h> int main(){ int i,j; int data[6]; for(i=0;i<6;i++){ scanf("%d",&data[i]); } data[0]=data[0]+data[1]; data[1]=data[2]+data[3]; data[2]=data[4]+data[5]; for(i=0;i<3;i++){ for(j=0;j<10;j++){ if(data[i]<10){ data[i+3]=j; }else{ data[i]=(int)data[i]/10; } } printf("%d",data[i+3]); } getchar(); return 0; ???
a.cc: In function 'int main()': a.cc:28:1: error: expected primary-expression before '?' token 28 | ??? | ^ a.cc:28:2: error: expected primary-expression before '?' token 28 | ??? | ^ a.cc:28:3: error: expected primary-expression before '?' token 28 | ??? | ^ a.cc:28:4: error: expected primary-expression at end of input 28 | ??? | ^ a.cc:28:4: error: expected ':' at end of input 28 | ??? | ^ | : a.cc:28:4: error: expected primary-expression at end of input a.cc:28:4: error: expected ':' at end of input 28 | ??? | ^ | : a.cc:28:4: error: expected primary-expression at end of input a.cc:28:4: error: expected ':' at end of input 28 | ??? | ^ | : a.cc:28:4: error: expected primary-expression at end of input a.cc:28:4: error: expected '}' at end of input a.cc:3:11: note: to match this '{' 3 | int main(){ | ^
s481779671
p00002
C++
include <stdio.h> #define MAX 200 int main(void) { int i,count; int arr[3][MAX]; int dig[MAX]; // input for (i=0; ; i++) { if(scanf("%d %d", &arr[0][i], &arr[1][i]) == EOF) break; arr[2][i] = arr[0][i] + arr[1][i]; count++; } // calc for (i=0; i < count; ++i){ while (1) { arr[2][i] /= 10; dig[i]++; if(arr[2][i] == 0) break; } } //output for (i = 0; i < count; ++i) { printf("%d\n", dig[i]); } return 0; }
a.cc:1:1: error: 'include' does not name a type 1 | include <stdio.h> | ^~~~~~~
s245734637
p00002
C++
5 7 1 99 1000 999
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 5 7 | ^
s821165779
p00002
C++
//#define scanf_s scanf #include <string> #include <stdio.h> #include <math.h> #include <stack> #include <queue> #include <list> #include <vector> #include <iostream> #include <algorithm> using namespace std; #define MAX 200 int main(void) { int a, b, sum, cou = 0; int ans[MAX] = { 0 }; while (scanf_s("%d %d", &a, &b) != EOF) { sum = a + b; ++ans[cou]; if (sum != 0){ while (1) { if (sum <= 1) break; sum /= 10; ++ans[cou]; } } ++cou; } for (int i = 0; i < cou; ++i) { printf("%d\n", ans[i]); } }
a.cc: In function 'int main()': a.cc:17:16: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 17 | while (scanf_s("%d %d", &a, &b) != EOF) { | ^~~~~~~ | scanf
s553346192
p00002
C++
//#define scanf_s scanf #include <stdio.h> #include <iostream> using namespace std; #define MAX 200 int main(void) { int a, b, sum, cou = 0; while (scanf_s("%d %d", &a, &b) != EOF) { sum = a + b; ++cou; if (sum != 0){ while (1) { if (sum <= 1) break; sum /= 10; ++cou; } } printf("%d", cou); cou = 0; } }
a.cc: In function 'int main()': a.cc:9:16: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 9 | while (scanf_s("%d %d", &a, &b) != EOF) { | ^~~~~~~ | scanf
s917847254
p00002
C++
#include "stdafx.h" int main() { int a,b,digit; scanf("%d %d", &a, &b); digit = 0; while(a != 0){ a = a / 10; ++digit; } while (b != 0) { b = b / 10; ++digit; } printf("%d", digit); return 0; }
a.cc:1:10: fatal error: stdafx.h: No such file or directory 1 | #include "stdafx.h" | ^~~~~~~~~~ compilation terminated.
s161644235
p00002
C++
#include<stdio.h> int main(void) { int a,b,cnt,s; while(scanf("%d %d",&a,&b)=EOF){ cnt=0; s=a+b; while(s>0){ s=s/10; cnt++; } printf("%d\n",cnt); } return 0; }
a.cc: In function 'int main()': a.cc:5:20: error: lvalue required as left operand of assignment 5 | while(scanf("%d %d",&a,&b)=EOF){ | ~~~~~^~~~~~~~~~~~~~~
s670039888
p00002
C++
#include<iostream> #include <algorithm> using namespace std; int main(){ int a, b, i = 0; cin >> a >> b; num = a*b; while(1){ if(num < 10) break; i++; num /= 10; } cout << i << endl; return 0; }
a.cc: In function 'int main()': a.cc:8:9: error: 'num' was not declared in this scope; did you mean 'enum'? 8 | num = a*b; | ^~~ | enum
s757905324
p00002
C++
#include<iostream> #include <algorithm> using namespace std; int main(){ int a, b, num; cin >> a >> b; num = a * b; while(num != 0){ num /= 10; i++; } cout << i << endl; return 0; }
a.cc: In function 'int main()': a.cc:12:17: error: 'i' was not declared in this scope 12 | i++; | ^ a.cc:14:17: error: 'i' was not declared in this scope 14 | cout << i << endl; | ^
s505234903
p00002
C++
#include<iostream> #include <algorithm> using namespace std; int main(){ int a, b, num; cin >> a >> b; num = a * b; cout << (int)log10(num) + 1 << endl; return 0; }
a.cc: In function 'int main()': a.cc:10:22: error: 'log10' was not declared in this scope 10 | cout << (int)log10(num) + 1 << endl; | ^~~~~
s484757654
p00002
C++
#include<iostream> using namespace std; int main(){ int a[200], b[200], damy, i; for(i = 0; i < 3; i++){ cin >> a[i] >> b[i]; } for(i = 0; i < 3; i++){ damy = a[i] + b[i]; for(int k = 0; damy != 0; k++){ damy /= 10; } cout << k <<endl; } return 0; }
a.cc: In function 'int main()': a.cc:16:25: error: 'k' was not declared in this scope 16 | cout << k <<endl; | ^
s014116592
p00002
C++
#include<iostream> #include<math.h> int main(){ double a,b; while(cin>>a>>b){ a=a+b; if(a<10)cout<<"1"<<endl; else { b=log10(a); cout<<b<<endl; } } return 0; }
a.cc: In function 'int main()': a.cc:8:7: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 8 | while(cin>>a>>b){ | ^~~ | std::cin In file included from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:10:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 10 | if(a<10)cout<<"1"<<endl; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:10:20: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 10 | if(a<10)cout<<"1"<<endl; | ^~~~ | std::endl In file included from /usr/include/c++/14/iostream:41: /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~ a.cc:13:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 13 | cout<<b<<endl; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:13:10: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 13 | cout<<b<<endl; | ^~~~ | std::endl /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
s014164198
p00002
C++
#include <cstdio> #include <iostream> using namespace std; int main() { int a, b; while (cin >> a >> b) { a = log10(a + b) + 1; cout << a << endl; } return 0; }
a.cc: In function 'int main()': a.cc:8:21: error: 'log10' was not declared in this scope 8 | a = log10(a + b) + 1; | ^~~~~
s059126228
p00002
C++
def get_input(): while True: try: yield ''.join(raw_input()) except EOFError: break if __name__ == '__main__': a = list(get_input()) for n in a: inl=n.split() num=inl[0]+inl[1] l=list(num) time=0 for i in l: time+=1 print time
a.cc:4:19: error: empty character constant 4 | yield ''.join(raw_input()) | ^~ a.cc:8:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes 8 | if __name__ == '__main__': | ^~~~~~~~~~ a.cc:1:1: error: 'def' does not name a type 1 | def get_input(): | ^~~
s148576913
p00002
C++
num = [] i=1 while a = gets num = a.split(" ") sum = num[0].to_i + num[1].to_i puts sum.to_s.size end
a.cc:1:1: error: 'num' does not name a type; did you mean 'enum'? 1 | num = [] | ^~~ | enum
s028415912
p00002
C++
#include<iostream> #include<cstdio> #include<algorithm> using namespace std; int main(){ int a,b; while(scans(" %d %d",&a,&b){ int cnt=1; for(int i=1;i<8;i++){ if(a+b-i*10<0)break; cnt++; } cout << ont << endl; return 0; }
a.cc: In function 'int main()': a.cc:9:7: error: 'scans' was not declared in this scope; did you mean 'scanf'? 9 | while(scans(" %d %d",&a,&b){ | ^~~~~ | scanf a.cc:9:28: error: expected ')' before '{' token 9 | while(scans(" %d %d",&a,&b){ | ~ ^ | ) a.cc:16:9: error: 'ont' was not declared in this scope; did you mean 'cnt'? 16 | cout << ont << endl; | ^~~ | cnt a.cc:19:2: error: expected '}' at end of input 19 | } | ^ a.cc:6:11: note: to match this '{' 6 | int main(){ | ^
s737569879
p00002
C++
#include<iostream> #include<cstdio> #include<algorithm> using namespace std; int main(){ int a,b; while(scanf(" %d %d",&a,&b){ int cnt=1; for(int i=1;i<8;i++){ if(a+b-i*10<0)break; cnt++; } cout << ont << endl; return 0; }
a.cc: In function 'int main()': a.cc:9:28: error: expected ')' before '{' token 9 | while(scanf(" %d %d",&a,&b){ | ~ ^ | ) a.cc:16:9: error: 'ont' was not declared in this scope; did you mean 'cnt'? 16 | cout << ont << endl; | ^~~ | cnt a.cc:19:2: error: expected '}' at end of input 19 | } | ^ a.cc:6:11: note: to match this '{' 6 | int main(){ | ^
s927591158
p00002
C++
#include<iostream> #include<cstdio> #include<algorithm> using namespace std; int main(){ int a,b; while(scanf(" %d %d",&a,&b)){ int cnt=1; for(int i=1;i<8;i++){ if(a+b-i*10<0)break; cnt++; } cout << ont << endl; return 0; }
a.cc: In function 'int main()': a.cc:16:9: error: 'ont' was not declared in this scope; did you mean 'cnt'? 16 | cout << ont << endl; | ^~~ | cnt a.cc:19:2: error: expected '}' at end of input 19 | } | ^ a.cc:6:11: note: to match this '{' 6 | int main(){ | ^
s285511059
p00002
C++
#include<iostream> #include<cstdio> #include<algorithm> using namespace std; int main(){ int a,b; while(scanf(" %d %d",&a,&b)){ int cnt=1; for(int i=1;i<8;i++){ if(a+b-i*10<0)break; cnt++; } cout << cnt << endl; return 0; }
a.cc: In function 'int main()': a.cc:19:2: error: expected '}' at end of input 19 | } | ^ a.cc:6:11: note: to match this '{' 6 | int main(){ | ^
s939761495
p00002
C++
#include<iostream> #include<cstdio> #include<algorithm> using namespace std; int main(){ int a,b; while(scanf(" %d %d",&a,&b)){ int cnt=1; for(int i=1;i<8;i++){ if(a+b-i*10<0)break; cnt++; } } cout << cnt << endl; return 0; }
a.cc: In function 'int main()': a.cc:17:9: error: 'cnt' was not declared in this scope; did you mean 'int'? 17 | cout << cnt << endl; | ^~~ | int
s475528477
p00002
C++
#include <iosteram> using namespace std; int main() { int a, b, ans; while (cin >> a >> b) { int c = a + b; for (ans = 1; c /= 10; ans++) ; cout << ans << endl; } }
a.cc:1:10: fatal error: iosteram: No such file or directory 1 | #include <iosteram> | ^~~~~~~~~~ compilation terminated.
s894497228
p00002
C++
using System; using System.Linq; public class Program { private static void Main(string[] args) { string line; while (!string.IsNullOrEmpty(line = Console.ReadLine())) { Console.WriteLine(line.Split().Select(int.Parse).Sum().ToString().Length); } } }
a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System; | ^~~~~~ a.cc:2:7: error: expected nested-name-specifier before 'System' 2 | using System.Linq; | ^~~~~~ a.cc:4:1: error: expected unqualified-id before 'public' 4 | public class Program | ^~~~~~
s136681517
p00002
C++
#include <iostream> using namespace std; int main() { int a, b; while (cin >> a >> b) { cout << (int)log10(a + b) + 1 << endl; } return 0; }
a.cc: In function 'int main()': a.cc:10:30: error: 'log10' was not declared in this scope 10 | cout << (int)log10(a + b) + 1 << endl; | ^~~~~
s375275673
p00002
C++
include<bits/stdc++.h> #include<cmath> using namespace std; int main(){ int a,b; while(cin>>a>>b){ a=log10(a+b)+1; cout<<a<<endl; } return 0; }
a.cc:1:1: error: 'include' does not name a type 1 | include<bits/stdc++.h> | ^~~~~~~ In file included from /usr/include/c++/14/cmath:45, from a.cc:2: /usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu_cxx::__is_null_pointer' redeclared as different kind of entity 164 | __is_null_pointer(std::nullptr_t) | ^ /usr/include/c++/14/ext/type_traits.h:159:5: note: previous declaration 'template<class _Type> constexpr bool __gnu_cxx::__is_null_pointer(_Type)' 159 | __is_null_pointer(_Type) | ^~~~~~~~~~~~~~~~~ /usr/include/c++/14/ext/type_traits.h:164:26: error: 'nullptr_t' is not a member of 'std' 164 | __is_null_pointer(std::nullptr_t) | ^~~~~~~~~ In file included from /usr/include/c++/14/bits/stl_pair.h:60, from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/bits/specfun.h:43, from /usr/include/c++/14/cmath:3906: /usr/include/c++/14/type_traits:666:33: error: 'nullptr_t' is not a member of 'std' 666 | struct is_null_pointer<std::nullptr_t> | ^~~~~~~~~ /usr/include/c++/14/type_traits:666:42: error: template argument 1 is invalid 666 | struct is_null_pointer<std::nullptr_t> | ^ /usr/include/c++/14/type_traits:670:48: error: template argument 1 is invalid 670 | struct is_null_pointer<const std::nullptr_t> | ^ /usr/include/c++/14/type_traits:674:51: error: template argument 1 is invalid 674 | struct is_null_pointer<volatile std::nullptr_t> | ^ /usr/include/c++/14/type_traits:678:57: error: template argument 1 is invalid 678 | struct is_null_pointer<const volatile std::nullptr_t> | ^ /usr/include/c++/14/type_traits:1429:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1429 | : public integral_constant<std::size_t, alignof(_Tp)> | ^~~~~~ In file included from /usr/include/stdlib.h:32, from /usr/include/c++/14/bits/std_abs.h:38, from /usr/include/c++/14/cmath:49: /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1429:57: error: template argument 1 is invalid 1429 | : public integral_constant<std::size_t, alignof(_Tp)> | ^ /usr/include/c++/14/type_traits:1429:57: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1438:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1438 | : public integral_constant<std::size_t, 0> { }; | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1438:46: error: template argument 1 is invalid 1438 | : public integral_constant<std::size_t, 0> { }; | ^ /usr/include/c++/14/type_traits:1438:46: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1440:26: error: 'std::size_t' has not been declared 1440 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:1441:21: error: '_Size' was not declared in this scope 1441 | struct rank<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:1441:27: error: template argument 1 is invalid 1441 | struct rank<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:1442:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1442:65: error: template argument 1 is invalid 1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^ /usr/include/c++/14/type_traits:1442:65: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1446:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1446:65: error: template argument 1 is invalid 1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^ /usr/include/c++/14/type_traits:1446:65: note: invalid template non-type parameter /usr/include/c++/14/type_traits:2086:26: error: 'std::size_t' has not been declared 2086 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:2087:30: error: '_Size' was not declared in this scope 2087 | struct remove_extent<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:2087:36: error: template argument 1 is invalid 2087 | struct remove_extent<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:2099:26: error: 'std::size_t' has not been declared 2099 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:2100:35: error: '_Size' was not declared in this scope 2100 | struct remove_all_extents<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:2100:41: error: template argument 1 is invalid 2100 | struct remove_all_extents<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:2171:12: error: 'std::size_t' has not been declared 2171 | template<std::size_t _Len> | ^~~ /usr/include/c++/14/type_traits:2176:30: error: '_Len' was not declared in this scope 2176 | unsigned char __data[_Len]; | ^~~~ /usr/include/c++/14/type_traits:2194:12: error: 'std::size_t' has not been declared 2194 | template<std::size_t _Len, std::size_t _Align = | ^~~ /usr/include/c++/14/type_traits:2194:30: error: 'std::size_t' has not been declared 2194 | template<std::size_t _Len, std::size_t _Align = | ^~~ /usr/include/c++/14/type_traits:2195:55: error: '_Len' was not declared in this scope 2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)> | ^~~~ /usr/include/c++/14/type_traits:2195:59: error: template argument 1 is invalid 2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)> | ^ /usr/include/c++/14/type_traits:2202:30: error: '_Len' was not declared in this scope 2202 | unsigned char __data[_Len]; | ^~~~ /usr/include/c++/14/type_traits:2203:44: error: '_Align' was not declared in this scope 2203 | struct __attribute__((__aligned__((_Align)))) { } __align; | ^~~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:65: /usr/include/c++/14/bits/stl_iterator_base_types.h:125:67: error: 'ptrdiff_t' does not name a type 125 | template<typename _Category, typename _Tp, typename _Distance = ptrdiff_t, | ^~~~~~~~~ /usr/include/c++/14/bits/stl_iterator_base_types.h:1:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' +++ |+#include <cstddef> 1 | // Types used in iterator implementation -*- C++ -*- /usr/include/c++/14/bits/stl_iterator_base_types.h:214:15: error: 'ptrdiff_t' does not name a type 214 | typedef ptrdiff_t difference_type; | ^~~~~~~~~ /usr/include/c++/14/bits/stl_iterator_base_types.h:214:15: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/c++/14/bits/stl_iterator_base_types.h:225:15: error: 'ptrdiff_t' does not name a type 225 | typedef ptrdiff_t difference_type; | ^~~~~~~~~ /usr/include/c++/14/bits/stl_iterator_base_types.h:225:15: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' In file included from /usr/include/c++/14/bits/stl_algobase.h:66: /usr/include/c++/14/bits/stl_iterator_base_funcs.h:112:5: error: 'ptrdiff_t' does not name a type 112 | ptrdiff_t | ^~~~~~~~~ /usr/include/c++/14/bits/stl_iterator_base_funcs.h:66:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' 65 | #include <debug/assertions.h> +++ |+#include <cstddef> 66 | #include <bits/stl_iterator_base_types.h> /usr/include/c++/14/bits/stl_iterator_base_funcs.h:118:5: error: 'ptrdiff_t' does not name a type 118 | ptrdiff_t | ^~~~~~~~~ /usr/include/c++/14/bits/stl_iterator_base_funcs.h:118:5: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' In file included from /usr/include/c++/14/bits/stl_iterator.h:67, from /usr/include/c++/14/bits/stl_algobase.h:67: /usr/include/c++/14
s681934504
p00002
C++
#include <iostream> #include <> int main(){ int a, b, c; int i = 1; int num = 0; std::cin >> a; std::cin >> b; c = a + b; while(1){ if(c/i!=0){ num++; }else{ break; } } std::cout << num << std::endl; return 0; }
a.cc:2:10: error: empty filename in #include 2 | #include <> | ^~
s546183112
p00002
C++
import Data.List.Split import Control.Applicative readInt = (read :: String -> Integer) main = do s <- (splitOn "\n") <$> getContents let nums = [map readInt $ splitOn " " t | t <- s] putStr $ unlines [show $ x + y | [x,y] <- nums]
a.cc:1:1: error: 'import' does not name a type 1 | import Data.List.Split | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
s979330479
p00002
C++
#include<iostream> using namespace std; int main(void){ int a, b, sum, cnt; for(cin >> a >> b){ cnt = 0; sum = a+b; while(sum){ sum/=10; cnt++; } cout << cnt <<endl; } return 0; }
a.cc: In function 'int main()': a.cc:6:22: error: expected ';' before ')' token 6 | for(cin >> a >> b){ | ^ | ; a.cc:15:5: error: expected primary-expression before 'return' 15 | return 0; | ^~~~~~ a.cc:14:6: error: expected ';' before 'return' 14 | } | ^ | ; 15 | return 0; | ~~~~~~ a.cc:15:5: error: expected primary-expression before 'return' 15 | return 0; | ^~~~~~ a.cc:14:6: error: expected ')' before 'return' 14 | } | ^ | ) 15 | return 0; | ~~~~~~ a.cc:6:8: note: to match this '(' 6 | for(cin >> a >> b){ | ^
s859802533
p00002
C++
#include<iostream> using namespace std; int main(){ for(int i=0;i<200;i++){ int a,b,i=0; cin>>a>>b; int num=1; int c=a+b; while(c/10!=0){ num++; c/=10; } cout<<num<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:5:13: error: redeclaration of 'int i' 5 | int a,b,i=0; | ^ a.cc:4:11: note: 'int i' previously declared here 4 | for(int i=0;i<200;i++){ | ^
s629372967
p00002
C++
#include<stdio.h> int main(void) { int a, b, c; scamf("%d %d", &a, &b); c = a+b; printf("%d\n", c/10); return 0; }
a.cc: In function 'int main()': a.cc:5:9: error: 'scamf' was not declared in this scope; did you mean 'scanf'? 5 | scamf("%d %d", &a, &b); | ^~~~~ | scanf
s114922210
p00002
C++
#include<stdio.h> int main(void) { int a[100], b[100], c, i; for(i=0;(a[i]!='\n')||(b[i]!='\n');i++) { scanf("%d %d", &a[i], &b[i]); c = a[i]+b[i]; printf("%d\n", log(c)); } return 0; }
a.cc: In function 'int main()': a.cc:9:32: error: 'log' was not declared in this scope; did you mean 'long'? 9 | printf("%d\n", log(c)); | ^~~ | long
s207751880
p00002
C++
#include <iostream> using namespace std; int main() { int a,b; while (1){ cin >> a; if (a == EOF) return; cin >> b; if (b == EOF) return; cout << a + b << endl; } }
a.cc: In function 'int main()': a.cc:9:31: error: return-statement with no value, in function returning 'int' [-fpermissive] 9 | if (a == EOF) return; | ^~~~~~ a.cc:11:31: error: return-statement with no value, in function returning 'int' [-fpermissive] 11 | if (b == EOF) return; | ^~~~~~
s163897700
p00002
C++
#include <iostream> using namespace std; int main() { int a,b; while (1){ cin >> a; if (a == EOF) return; cin >> b; if (b == EOF) return; cout << a + b << endl; } }
a.cc: In function 'int main()': a.cc:9:31: error: return-statement with no value, in function returning 'int' [-fpermissive] 9 | if (a == EOF) return; | ^~~~~~ a.cc:11:31: error: return-statement with no value, in function returning 'int' [-fpermissive] 11 | if (b == EOF) return; | ^~~~~~
s905455466
p00002
C++
using System; class main(){ public static void Main(String[] a){ string[] s=new string[200]; for(int i;i<200;i++){ s[i]=Console.ReadLine(); } string[] s1=new string[2]; long a,b.d,dk; foreach(sa in s){ if(IsNullOrEmpty(sa))continue; s1=sa.Split(' '); a=long.Parse(s1[0]); b=long.Parse(s1[1]); d=a+b; dk=(string)d.Length; Console.WriteLine(dk); } }}
a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System; | ^~~~~~ a.cc:3:12: error: expected unqualified-id before ')' token 3 | class main(){ | ^
s030570939
p00002
C++
#include<iostream> using namespace std; int main() { int a, b; while (cin >> a >> b) { int n = 1; for(int i = 0; ; i++) { if (a + b < n) { cout << i << endl; break; } n = n * 10; } } return 0;
a.cc: In function 'int main()': a.cc:19:14: error: expected '}' at end of input 19 | return 0; | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^
s049842474
p00002
C++
#include<iostream> using namespace std; int main(){ for(int a,b,c,ans=1;cin >> a;cin >> b;){ c=a+b; if(c>=10){ ans++; } if(c>=100){ ans++; } if(c>=1000){ ans++; } if(c>=10000){ ans++; } if(c>=100000){ ans++; } if(c>=1000000){ ans++; } cout << ans; } return 0; }
a.cc: In function 'int main()': a.cc:5:40: error: expected ')' before ';' token 5 | for(int a,b,c,ans=1;cin >> a;cin >> b;){ | ~ ^ | ) a.cc:5:41: error: expected primary-expression before ')' token 5 | for(int a,b,c,ans=1;cin >> a;cin >> b;){ | ^
s276376378
p00002
C++
#include<iostream> #include<cmath> using namespace std; int main(){ string s; int a,b,c; while (getline(cin, s )) { 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; }
a.cc: In function 'int main()': a.cc:10:25: error: variable 'std::istringstream iss1' has initializer but incomplete type 10 | std::istringstream iss1(s.substr(0,SpaceInd)); | ^ a.cc:10:36: error: 'SpaceInd' was not declared in this scope 10 | std::istringstream iss1(s.substr(0,SpaceInd)); | ^~~~~~~~ a.cc:13:25: error: variable 'std::istringstream iss2' has initializer but incomplete type 13 | std::istringstream iss2(s.substr(SpaceInd+1)); | ^
s437868422
p00002
C++
#include<bits/c++.h> using namespace std; int main(){ string s; int a,b,c; while (getline(cin, s )) { 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; }
a.cc:1:9: fatal error: bits/c++.h: No such file or directory 1 | #include<bits/c++.h> | ^~~~~~~~~~~~ compilation terminated.
s543394426
p00002
C++
#include<iostream> #include<sstream> #include<cmath> using namespace std; int main(){ string s; int a,b,c; while (getline(cin, s )) { 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; }
a.cc: In function 'int main()': a.cc:11:36: error: 'SpaceInd' was not declared in this scope 11 | std::istringstream iss1(s.substr(0,SpaceInd)); | ^~~~~~~~
s775693583
p00002
C++
HAhahahah xwhdxjwhxkedx ed edc de ce cde cejdlcekdjlekjcded cedjedejdklkexjelkxjlkexdjlx
a.cc:1:1: error: 'HAhahahah' does not name a type 1 | HAhahahah | ^~~~~~~~~
s064104322
p00002
C++
#include<bits/stdc++.h> using namespace std; int main(){ int a,b; int k=1; while(cin>>a>>b){ while(a+b>=pow(10,k)){ k++; } } cout<<k<<endl; } return(0); }
a.cc:14:5: error: expected unqualified-id before 'return' 14 | return(0); | ^~~~~~ a.cc:15:1: error: expected declaration before '}' token 15 | } | ^
s333977059
p00002
C++
#include<bits/stdc++.h> using namespace std; int main(){ int a,b; int k=1; int m=10; while(cin>>a>>b){ while(a+b>=m/*pow(10,k)*/){ k++; m*=10; } } cout<<k<<endl; } return(0); }
a.cc:16:5: error: expected unqualified-id before 'return' 16 | return(0); | ^~~~~~ a.cc:17:1: error: expected declaration before '}' token 17 | } | ^
s283231733
p00002
C++
#include<cstdio> #include<iostream> #include<cstring> // ??????????????????????±??????????????????? using namespace std; int main(){ int a,b,s=0,l; char str[100]; cin >> a >> b; s=a+b; itoa(s,str,10); // s???10?????°??§?????????????????? l = strlen(str); // ??????????????????????????? cout << l; }
a.cc: In function 'int main()': a.cc:12:9: error: 'itoa' was not declared in this scope 12 | itoa(s,str,10); // s???10?????°??§?????????????????? | ^~~~
s428048013
p00002
C++
#include<cstdio> #include<iostream> #include<cstring> // ??????????????????????±??????????????????? using namespace std; int main(){ int a,b,s=0,l; char str[100]; cin >> a >> b; s=a+b; itoa(s,str,10); // s???10?????°??§?????????????????? l = strlen(str); // ??????????????????????????? cout << l << "\n"; }
a.cc: In function 'int main()': a.cc:12:9: error: 'itoa' was not declared in this scope 12 | itoa(s,str,10); // s???10?????°??§?????????????????? | ^~~~
s301857420
p00002
C++
#include<cstdio> #include<iostream> #include<cstring> // ??????????????????????±??????????????????? using namespace std; int main(){ while(1){ int a,b,s=0,l; char str[100]; cin >> a >> b; s=a+b; itoa(s,str,10); // s???10?????°??§?????????????????? l = strlen(str); // ??????????????????????????? cout << l << "\n"; } }
a.cc: In function 'int main()': a.cc:14:9: error: 'itoa' was not declared in this scope 14 | itoa(s,str,10); // s???10?????°??§?????????????????? | ^~~~
s673145330
p00002
C++
#include<cstdio> #include<iostream> #include<cstring> // ??????????????????????±??????????????????? using namespace std; int main(){ int n; while( scanf("%d",&n) != EOF ){ int a,b,s=0,l; char str[100]; cin >> a >> b; s=a+b; itoa(s,str,10); // s???10?????°??§?????????????????? l = strlen(str); // ??????????????????????????? cout << l << "\n"; } }
a.cc: In function 'int main()': a.cc:14:17: error: 'itoa' was not declared in this scope 14 | itoa(s,str,10); // s???10?????°??§?????????????????? | ^~~~
s606738665
p00002
C++
#include<cstdio> #include<iostream> #include<cstring> // ??????????????????????±??????????????????? using namespace std; int main(){ int a,b,s=0,l; while( cin >> a >> b ){ char str[100]; s=a+b; itoa(s,str,10); // s???10?????°??§?????????????????? l = strlen(str); // ??????????????????????????? cout << l << "\n"; } return 0; }
a.cc: In function 'int main()': a.cc:11:17: error: 'itoa' was not declared in this scope 11 | itoa(s,str,10); // s???10?????°??§?????????????????? | ^~~~
s335797922
p00002
C++
#include<cstdio> #include <cstdlib> #include<iostream> #include<cstring> // ??????????????????????±??????????????????? using namespace std; int main(){ int a,b,s=0,l; while( cin >> a >> b ){ char str[100]; s=a+b; itoa(s,str,10); // s???10?????°??§?????????????????? l = strlen(str); // ??????????????????????????? cout << l << "\n"; } return 0; }
a.cc: In function 'int main()': a.cc:12:17: error: 'itoa' was not declared in this scope 12 | itoa(s,str,10); // s???10?????°??§?????????????????? | ^~~~
s302820796
p00002
C++
#include<cstdio> #include <stdlib.h> #include<iostream> #include<cstring> // ??????????????????????±??????????????????? using namespace std; int main(){ int a,b,s=0,l; while( cin >> a >> b ){ char str[100]; s=a+b; itoa(s,str,10); // s???10?????°??§?????????????????? l = strlen(str); // ??????????????????????????? cout << l << "\n"; } return 0; }
a.cc: In function 'int main()': a.cc:12:17: error: 'itoa' was not declared in this scope 12 | itoa(s,str,10); // s???10?????°??§?????????????????? | ^~~~
s528185481
p00002
C++
#include<stdio.h> #include <stdlib.h> #include<iostream> #include<cstring> // ??????????????????????±??????????????????? using namespace std; int main(){ int a,b,s=0,l; while( cin >> a >> b ){ char str[100]; s=a+b; itoa(s,str,10); // s???10?????°??§?????????????????? l = strlen(str); // ??????????????????????????? cout << l << "\n"; } return 0; }
a.cc: In function 'int main()': a.cc:12:17: error: 'itoa' was not declared in this scope 12 | itoa(s,str,10); // s???10?????°??§?????????????????? | ^~~~
s865564155
p00002
C++
#include<stdio.h> #include<stdlib.h> #include<unistd.h> #include<iostream> #include<cstring> // ??????????????????????±??????????????????? using namespace std; int main(){ int a,b,s=0,l; while( cin >> a >> b ){ char str[100]; s=a+b; itoa(s,str,10); // s???10?????°??§?????????????????? l = strlen(str); // ??????????????????????????? cout << l << "\n"; } return 0; }
a.cc: In function 'int main()': a.cc:13:17: error: 'itoa' was not declared in this scope 13 | itoa(s,str,10); // s???10?????°??§?????????????????? | ^~~~
s418548850
p00002
C++
#include<iostream> #include<stdio.h> #include<string.h> #include<math.h> using namespace std; #define MAX 256 int f(int z){ int z; if (z < 10)return 1; return 1 + f(z / 10); } int main(void){ int ans[200]; for (long i = 0; i < 200; i++){ ans[i] = 0; } long a, b; long i = 0; while (scanf("%ld%ld", &a, &b) != EOF){ ans[i] = f(a, b); i++; } for (int j = 0; j < i; j++){ printf("%d\n", ans[j]); } return 0; }
a.cc: In function 'int f(int)': a.cc:10:13: error: declaration of 'int z' shadows a parameter 10 | int z; | ^ a.cc:9:11: note: 'int z' previously declared here 9 | int f(int z){ | ~~~~^ a.cc: In function 'int main()': a.cc:26:27: error: too many arguments to function 'int f(int)' 26 | ans[i] = f(a, b); | ~^~~~~~ a.cc:9:5: note: declared here 9 | int f(int z){ | ^
s301421442
p00002
C++
import sys for line in sys.stdin: a,b=map(int,line.split()) print(len(str(a+b)))
a.cc:1:1: error: 'import' does not name a type 1 | import sys | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
s688907887
p00002
C++
input = raw_input() splited = input.split() num = int(splited[0])+int(splited[1]) print len(str(num))
a.cc:1:1: error: 'input' does not name a type; did you mean 'int'? 1 | input = raw_input() | ^~~~~ | int
s892368959
p00002
C++
#include<string> #include<algorithm> #include<iostream> #include<cstdio> using namespace std; int main() { int a,b; cin >> a>>b; string x=IntToString(a+B); cout<<x.size()<<endl; return 0; } string IntToString(int number) { string stream ss; ss << number; return ss.str(); }
a.cc: In function 'int main()': a.cc:10:25: error: 'B' was not declared in this scope 10 | string x=IntToString(a+B); | ^ a.cc:10:11: error: 'IntToString' was not declared in this scope 10 | string x=IntToString(a+B); | ^~~~~~~~~~~ a.cc: In function 'std::string IntToString(int)': a.cc:16:17: error: expected initializer before 'ss' 16 | string stream ss; | ^~ a.cc:17:3: error: 'ss' was not declared in this scope 17 | ss << number; | ^~
s104597333
p00002
C++
#include<string> #include<algorithm> #include<iostream> #include<cstdio> using namespace std; int main() { int a,b; cin >> a>>b; string x=IntToString(a+b); cout<<x.size()<<endl; return 0; } string IntToString(int number) { string stream ss; ss << number; return ss.str(); }
a.cc: In function 'int main()': a.cc:10:11: error: 'IntToString' was not declared in this scope 10 | string x=IntToString(a+b); | ^~~~~~~~~~~ a.cc: In function 'std::string IntToString(int)': a.cc:16:17: error: expected initializer before 'ss' 16 | string stream ss; | ^~ a.cc:17:3: error: 'ss' was not declared in this scope 17 | ss << number; | ^~
s774772279
p00002
C++
#include<string> #include<algorithm> #include<iostream> #include<cstdio> using namespace std; int main() { int a,b; cin >> a>>b; string x=IntToString(a+b); cout<<x.size()<<endl; return 0; } string IntToString(int number) { string stream ss; ss << number; return ss.str(); }
a.cc: In function 'int main()': a.cc:10:11: error: 'IntToString' was not declared in this scope 10 | string x=IntToString(a+b); | ^~~~~~~~~~~ a.cc: In function 'std::string IntToString(int)': a.cc:16:17: error: expected initializer before 'ss' 16 | string stream ss; | ^~ a.cc:17:3: error: 'ss' was not declared in this scope 17 | ss << number; | ^~
s513543443
p00002
C++
#include<string> #include<algorithm> #include<iostream> #include<cstdio> using namespace std; int main() { int a,b; cin >> a>>b; string stream ss; ss << number; string x=ss.str() cout<<x.size()<<endl; return 0; } string IntToString(int number) { string stream ss; ss << number; return ss.str(); }
a.cc: In function 'int main()': a.cc:10:15: error: expected initializer before 'ss' 10 | string stream ss; | ^~ a.cc:11:3: error: 'ss' was not declared in this scope 11 | ss << number; | ^~ a.cc:11:9: error: 'number' was not declared in this scope 11 | ss << number; | ^~~~~~ a.cc: In function 'std::string IntToString(int)': a.cc:18:17: error: expected initializer before 'ss' 18 | string stream ss; | ^~ a.cc:19:3: error: 'ss' was not declared in this scope 19 | ss << number; | ^~
s090243232
p00002
C++
#include<string> #include<algorithm> #include<iostream> #include<cstdio> using namespace std; int main() { int a,b; cin >> a>>b; string stream ss; ss << number; string x=ss.str(); cout<<x.size()<<endl; return 0; } string IntToString(int number) { string stream ss; ss << number; return ss.str(); }
a.cc: In function 'int main()': a.cc:10:15: error: expected initializer before 'ss' 10 | string stream ss; | ^~ a.cc:11:3: error: 'ss' was not declared in this scope 11 | ss << number; | ^~ a.cc:11:9: error: 'number' was not declared in this scope 11 | ss << number; | ^~~~~~ a.cc: In function 'std::string IntToString(int)': a.cc:18:17: error: expected initializer before 'ss' 18 | string stream ss; | ^~ a.cc:19:3: error: 'ss' was not declared in this scope 19 | ss << number; | ^~
s152927811
p00002
C++
#include<string> #include<algorithm> #include<iostream> #include<cstdio> using namespace std; int main() { int a,b; cin >> a>>b; string stream ss; ss << number; string x=ss.str(); cout<<x.size()<<endl; return 0; }
a.cc: In function 'int main()': a.cc:10:15: error: expected initializer before 'ss' 10 | string stream ss; | ^~ a.cc:11:3: error: 'ss' was not declared in this scope 11 | ss << number; | ^~ a.cc:11:9: error: 'number' was not declared in this scope 11 | ss << number; | ^~~~~~
s232953615
p00002
C++
#include<string> #include<algorithm> #include<iostream> #include<cstdio> using namespace std; int main() { int a,b; cin >> a>>b; string stream ss; ss << a+b; string x=ss.str(); cout<<x.size()<<endl; return 0; }
a.cc: In function 'int main()': a.cc:10:15: error: expected initializer before 'ss' 10 | string stream ss; | ^~ a.cc:11:3: error: 'ss' was not declared in this scope 11 | ss << a+b; | ^~
s001712934
p00002
C++
#include<string> #include<algorithm> #include<iostream> #include<cstdio> using namespace std; int main() { int a,b; cin >> a>>b; string stream ss; string ss; ss << a+b; string x=ss.str(); cout<<x.size()<<endl; return 0; }
a.cc: In function 'int main()': a.cc:10:15: error: expected initializer before 'ss' 10 | string stream ss; | ^~ a.cc:12:6: error: no match for 'operator<<' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int') 12 | ss << a+b; | ~~ ^~ ~~~ | | | | | int | std::string {aka std::__cxx11::basic_string<char>} In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54, from a.cc:1: /usr/include/c++/14/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)' 763 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed: a.cc:12:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 12 | ss << a+b; | ^ /usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 4077 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed: a.cc:12:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 12 | ss << a+b; | ^ In file included from /usr/include/c++/14/bits/memory_resource.h:38, from /usr/include/c++/14/string:68: /usr/include/c++/14/cstddef:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)' 125 | operator<<(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed: a.cc:12:3: note: cannot convert 'ss' (type 'std::string' {aka 'std::__cxx11::basic_string<char>'}) to type 'std::byte' 12 | ss << a+b; | ^~ In file included from /usr/include/c++/14/bits/ios_base.h:46, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:3: /usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)' 339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e) | ^~~~~~~~ /usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed: a.cc:12:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 12 | ss << a+b; | ^ /usr/include/c++/14/ostream:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)' 563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c) | ^~~~~~~~ /usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed: a.cc:12:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 12 | ss << a+b; | ^ /usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)' 573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed: a.cc:12:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 12 | ss << a+b; | ^ /usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)' 579 | operator<<(basic_ostream<char, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed: a.cc:12:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 12 | ss << a+b; | ^ /usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)' 590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed: a.cc:12:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 12 | ss << a+b; | ^ /usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)' 595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed: a.cc:12:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 12 | ss << a+b; | ^ /usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)' 654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed: a.cc:12:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 12 | ss << a+b; | ^ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)' 307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed: a.cc:12:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 12 | ss << a+b; | ^ /usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)' 671 | operator<<(basic_ostream<char, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:671:5: note: template argument deduction/substitution failed: a.cc:12:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 12 | ss << a+b; | ^ /usr/include/c++/14/ostream:684:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const signed char*)' 684 | operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:684:5: note: template argument deduction/substitution failed: a.cc:12:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 12 | ss << a+b; | ^ /usr/include/c++/14/ostream:689:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const unsigned char*)' 689 | operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:689:5: note: template argument deduction/substitution failed: a.cc:12:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 12 | ss << a+b; | ^ /usr/include/c++/14/ostream:810:5: note: candidate: 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&)' 810 | operator<<(_Ostream&& __os, const _Tp& __x) | ^~~~~~~~ /usr/include/c++/14/ostream:810:5: note: template argument deduction/substitution failed: /usr/include/c++/14/ostream: In substitution of 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&) [with _Ostream = std::__cxx11::basic_string<char>&; _Tp = int]': a.cc:12:11: required from here 12 | ss << a+b; | ^ /usr/include/c++/14/ostream:810:5: error: no type named 'type' in 'struct std::enable_if<false, void>' 810 | operator<<(_Ostream&& __os, const _Tp& __x) | ^~~~~~~~ a.cc:13:16: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'str' 13 | string x=ss.str(); | ^~~
s948383467
p00002
C++
#include<string> #include<algorithm> #include<iostream> #include<cstdio> using namespace std; int main() { int a,b; cin >> a>>b; string ss; string ss=""; ss << a+b; string x=ss.str(); cout<<x.size()<<endl; return 0; }
a.cc: In function 'int main()': a.cc:11:8: error: redeclaration of 'std::string ss' 11 | string ss=""; | ^~ a.cc:10:9: note: 'std::string ss' previously declared here 10 | string ss; | ^~ a.cc:12:6: error: no match for 'operator<<' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int') 12 | ss << a+b; | ~~ ^~ ~~~ | | | | | int | std::string {aka std::__cxx11::basic_string<char>} In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54, from a.cc:1: /usr/include/c++/14/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)' 763 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed: a.cc:12:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 12 | ss << a+b; | ^ /usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 4077 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed: a.cc:12:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 12 | ss << a+b; | ^ In file included from /usr/include/c++/14/bits/memory_resource.h:38, from /usr/include/c++/14/string:68: /usr/include/c++/14/cstddef:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)' 125 | operator<<(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed: a.cc:12:3: note: cannot convert 'ss' (type 'std::string' {aka 'std::__cxx11::basic_string<char>'}) to type 'std::byte' 12 | ss << a+b; | ^~ In file included from /usr/include/c++/14/bits/ios_base.h:46, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:3: /usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)' 339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e) | ^~~~~~~~ /usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed: a.cc:12:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 12 | ss << a+b; | ^ /usr/include/c++/14/ostream:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)' 563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c) | ^~~~~~~~ /usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed: a.cc:12:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 12 | ss << a+b; | ^ /usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)' 573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed: a.cc:12:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 12 | ss << a+b; | ^ /usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)' 579 | operator<<(basic_ostream<char, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed: a.cc:12:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 12 | ss << a+b; | ^ /usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)' 590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed: a.cc:12:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 12 | ss << a+b; | ^ /usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)' 595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed: a.cc:12:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 12 | ss << a+b; | ^ /usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)' 654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed: a.cc:12:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 12 | ss << a+b; | ^ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)' 307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed: a.cc:12:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 12 | ss << a+b; | ^ /usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)' 671 | operator<<(basic_ostream<char, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:671:5: note: template argument deduction/substitution failed: a.cc:12:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 12 | ss << a+b; | ^ /usr/include/c++/14/ostream:684:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const signed char*)' 684 | operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:684:5: note: template argument deduction/substitution failed: a.cc:12:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 12 | ss << a+b; | ^ /usr/include/c++/14/ostream:689:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const unsigned char*)' 689 | operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:689:5: note: template argument deduction/substitution failed: a.cc:12:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 12 | ss << a+b; | ^ /usr/include/c++/14/ostream:810:5: note: candidate: 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&)' 810 | operator<<(_Ostream&& __os, const _Tp& __x) | ^~~~~~~~ /usr/include/c++/14/ostream:810:5: note: template argument deduction/substitution failed: /usr/include/c++/14/ostream: In substitution of 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&) [with _Ostream = std::__cxx11::basic_string<char>&; _Tp = int]': a.cc:12:11: required from here 12 | ss << a+b; | ^ /usr/include/c++/14/ostream:810:5: error: no type named 'type' in 'struct std::enable_if<false, void>' 810 | operator<<(_Ostream&& __os, const _Tp& __x) | ^~~~~~~~ a.cc:13:16: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'str' 13 | string x=ss.str(); | ^~~
s802398934
p00002
C++
#include<string> #include<algorithm> #include<iostream> #include<cstdio> using namespace std; int main() { int a,b; cin >> a>>b; string ss=""; ss << a+b; string x=ss.str(); cout<<x.size()<<endl; return 0; }
a.cc: In function 'int main()': a.cc:11:6: error: no match for 'operator<<' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int') 11 | ss << a+b; | ~~ ^~ ~~~ | | | | | int | std::string {aka std::__cxx11::basic_string<char>} In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54, from a.cc:1: /usr/include/c++/14/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)' 763 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed: a.cc:11:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 11 | ss << a+b; | ^ /usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 4077 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed: a.cc:11:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 11 | ss << a+b; | ^ In file included from /usr/include/c++/14/bits/memory_resource.h:38, from /usr/include/c++/14/string:68: /usr/include/c++/14/cstddef:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)' 125 | operator<<(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed: a.cc:11:3: note: cannot convert 'ss' (type 'std::string' {aka 'std::__cxx11::basic_string<char>'}) to type 'std::byte' 11 | ss << a+b; | ^~ In file included from /usr/include/c++/14/bits/ios_base.h:46, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:3: /usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)' 339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e) | ^~~~~~~~ /usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed: a.cc:11:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 11 | ss << a+b; | ^ /usr/include/c++/14/ostream:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)' 563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c) | ^~~~~~~~ /usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed: a.cc:11:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 11 | ss << a+b; | ^ /usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)' 573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed: a.cc:11:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 11 | ss << a+b; | ^ /usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)' 579 | operator<<(basic_ostream<char, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed: a.cc:11:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 11 | ss << a+b; | ^ /usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)' 590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed: a.cc:11:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 11 | ss << a+b; | ^ /usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)' 595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed: a.cc:11:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 11 | ss << a+b; | ^ /usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)' 654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed: a.cc:11:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 11 | ss << a+b; | ^ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)' 307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed: a.cc:11:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 11 | ss << a+b; | ^ /usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)' 671 | operator<<(basic_ostream<char, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:671:5: note: template argument deduction/substitution failed: a.cc:11:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 11 | ss << a+b; | ^ /usr/include/c++/14/ostream:684:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const signed char*)' 684 | operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:684:5: note: template argument deduction/substitution failed: a.cc:11:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 11 | ss << a+b; | ^ /usr/include/c++/14/ostream:689:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const unsigned char*)' 689 | operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:689:5: note: template argument deduction/substitution failed: a.cc:11:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 11 | ss << a+b; | ^ /usr/include/c++/14/ostream:810:5: note: candidate: 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&)' 810 | operator<<(_Ostream&& __os, const _Tp& __x) | ^~~~~~~~ /usr/include/c++/14/ostream:810:5: note: template argument deduction/substitution failed: /usr/include/c++/14/ostream: In substitution of 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&) [with _Ostream = std::__cxx11::basic_string<char>&; _Tp = int]': a.cc:11:11: required from here 11 | ss << a+b; | ^ /usr/include/c++/14/ostream:810:5: error: no type named 'type' in 'struct std::enable_if<false, void>' 810 | operator<<(_Ostream&& __os, const _Tp& __x) | ^~~~~~~~ a.cc:12:16: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'str' 12 | string x=ss.str(); | ^~~
s843635680
p00002
C++
#include<string> #include<algorithm> #include<iostream> #include<cstdio> using namespace std; int main() { int a,b; cin >> a>>b; string ss=""; ss >> a+b; cout<<ss.str().size()<<endl; return 0; }
a.cc: In function 'int main()': a.cc:11:6: error: no match for 'operator>>' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int') 11 | ss >> a+b; | ~~ ^~ ~~~ | | | | | int | std::string {aka std::__cxx11::basic_string<char>} In file included from /usr/include/c++/14/string:55, from a.cc:1: /usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 835 | operator>>(basic_istream<_CharT, _Traits>& __in, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed: a.cc:11:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 11 | ss >> a+b; | ^ In file included from /usr/include/c++/14/bits/memory_resource.h:38, from /usr/include/c++/14/string:68: /usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)' 131 | operator>>(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed: a.cc:11:3: note: cannot convert 'ss' (type 'std::string' {aka 'std::__cxx11::basic_string<char>'}) to type 'std::byte' 11 | ss >> a+b; | ^~ In file included from /usr/include/c++/14/istream:1109, from /usr/include/c++/14/iostream:42, from a.cc:3: /usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)' 978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c) | ^~~~~~~~ /usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed: a.cc:11:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 11 | ss >> a+b; | ^ /usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)' 849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed: a.cc:11:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_istream<char, _Traits>' 11 | ss >> a+b; | ^ /usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)' 854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed: a.cc:11:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_istream<char, _Traits>' 11 | ss >> a+b; | ^ /usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)' 896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed: a.cc:11:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 11 | ss >> a+b; | ^ /usr/include/c++/14/istream:939:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char*)' 939 | operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:939:5: note: template argument deduction/substitution failed: a.cc:11:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_istream<char, _Traits>' 11 | ss >> a+b; | ^ /usr/include/c++/14/istream:945:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char*)' 945 | operator>>(basic_istream<char, _Traits>& __in, signed char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:945:5: note: template argument deduction/substitution failed: a.cc:11:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_istream<char, _Traits>' 11 | ss >> a+b; | ^ /usr/include/c++/14/istream:1099:5: note: candidate: 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&)' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~ /usr/include/c++/14/istream:1099:5: note: template argument deduction/substitution failed: /usr/include/c++/14/istream: In substitution of 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&) [with _Istream = std::__cxx11::basic_string<char>&; _Tp = int]': a.cc:11:11: required from here 11 | ss >> a+b; | ^ /usr/include/c++/14/istream:1099:5: error: no type named 'type' in 'struct std::enable_if<false, void>' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~ a.cc:12:10: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'str' 12 | cout<<ss.str().size()<<endl; | ^~~
s711874441
p00002
C++
#include<string> #include<algorithm> #include<iostream> #include<cstdio> using namespace std; int main() { int a,b; cin >> a>>b; string ss=""; ss << a+b; cout<<ss.str().size()<<endl; return 0; }
a.cc: In function 'int main()': a.cc:11:6: error: no match for 'operator<<' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int') 11 | ss << a+b; | ~~ ^~ ~~~ | | | | | int | std::string {aka std::__cxx11::basic_string<char>} In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54, from a.cc:1: /usr/include/c++/14/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)' 763 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed: a.cc:11:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 11 | ss << a+b; | ^ /usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 4077 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed: a.cc:11:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 11 | ss << a+b; | ^ In file included from /usr/include/c++/14/bits/memory_resource.h:38, from /usr/include/c++/14/string:68: /usr/include/c++/14/cstddef:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)' 125 | operator<<(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed: a.cc:11:3: note: cannot convert 'ss' (type 'std::string' {aka 'std::__cxx11::basic_string<char>'}) to type 'std::byte' 11 | ss << a+b; | ^~ In file included from /usr/include/c++/14/bits/ios_base.h:46, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:3: /usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)' 339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e) | ^~~~~~~~ /usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed: a.cc:11:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 11 | ss << a+b; | ^ /usr/include/c++/14/ostream:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)' 563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c) | ^~~~~~~~ /usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed: a.cc:11:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 11 | ss << a+b; | ^ /usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)' 573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed: a.cc:11:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 11 | ss << a+b; | ^ /usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)' 579 | operator<<(basic_ostream<char, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed: a.cc:11:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 11 | ss << a+b; | ^ /usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)' 590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed: a.cc:11:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 11 | ss << a+b; | ^ /usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)' 595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed: a.cc:11:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 11 | ss << a+b; | ^ /usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)' 654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed: a.cc:11:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 11 | ss << a+b; | ^ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)' 307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed: a.cc:11:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 11 | ss << a+b; | ^ /usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)' 671 | operator<<(basic_ostream<char, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:671:5: note: template argument deduction/substitution failed: a.cc:11:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 11 | ss << a+b; | ^ /usr/include/c++/14/ostream:684:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const signed char*)' 684 | operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:684:5: note: template argument deduction/substitution failed: a.cc:11:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 11 | ss << a+b; | ^ /usr/include/c++/14/ostream:689:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const unsigned char*)' 689 | operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:689:5: note: template argument deduction/substitution failed: a.cc:11:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 11 | ss << a+b; | ^ /usr/include/c++/14/ostream:810:5: note: candidate: 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&)' 810 | operator<<(_Ostream&& __os, const _Tp& __x) | ^~~~~~~~ /usr/include/c++/14/ostream:810:5: note: template argument deduction/substitution failed: /usr/include/c++/14/ostream: In substitution of 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&) [with _Ostream = std::__cxx11::basic_string<char>&; _Tp = int]': a.cc:11:11: required from here 11 | ss << a+b; | ^ /usr/include/c++/14/ostream:810:5: error: no type named 'type' in 'struct std::enable_if<false, void>' 810 | operator<<(_Ostream&& __os, const _Tp& __x) | ^~~~~~~~ a.cc:12:10: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'str' 12 | cout<<ss.str().size()<<endl; | ^~~
s367654931
p00002
C++
#include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); } using namespace std; int main() { int a, b; while (cin>>a>>b) { cout << to_string(a+b).length() << endl; } return 0; }
a.cc:11:26: error: 'string' does not name a type; did you mean 'stdin'? 11 | template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); } | ^~~~~~ | stdin a.cc: In function 'int main()': a.cc:16:16: error: 'cin' was not declared in this scope 16 | while (cin>>a>>b) | ^~~ a.cc:8:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 7 | #include <stack> +++ |+#include <iostream> 8 | #include <string> a.cc:18:17: error: 'cout' was not declared in this scope 18 | cout << to_string(a+b).length() << endl; | ^~~~ a.cc:18:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
s144069788
p00002
C++
#include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); } using namespace std; int main() { int a, b; while (cin>>a>>b) { cout << to_string(a+b).length() << endl; } return 0; }
a.cc:11:26: error: 'string' does not name a type; did you mean 'stdin'? 11 | template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); } | ^~~~~~ | stdin a.cc: In function 'int main()': a.cc:16:16: error: 'cin' was not declared in this scope 16 | while (cin>>a>>b) | ^~~ a.cc:8:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 7 | #include <stack> +++ |+#include <iostream> 8 | #include <string> a.cc:18:17: error: 'cout' was not declared in this scope 18 | cout << to_string(a+b).length() << endl; | ^~~~ a.cc:18:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
s667165761
p00002
C++
#include <iostraem> using namespace std; int main() { int buff,buff2,result; cin >> buff >> buff2; while(buff != 0) { buff += buff2; buff /= 10; result++; } cout << result << endl; return 0; }
a.cc:1:10: fatal error: iostraem: No such file or directory 1 | #include <iostraem> | ^~~~~~~~~~ compilation terminated.
s990521395
p00002
C++
#include <iostream> using namespace std; int main() { int tmp,tmp2; cin >> tmp >> tmp2; tmp += tmp2; to_string(tmp); cout << tmp.length << endl; return 0; }
a.cc: In function 'int main()': a.cc:10:12: warning: ignoring return value of 'std::string std::__cxx11::to_string(int)', declared with attribute 'nodiscard' [-Wunused-result] 10 | to_string(tmp); | ~~~~~~~~~^~~~~ In file included from /usr/include/c++/14/string:54, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/basic_string.h:4240:3: note: declared here 4240 | to_string(int __val) | ^~~~~~~~~ a.cc:11:15: error: request for member 'length' in 'tmp', which is of non-class type 'int' 11 | cout << tmp.length << endl; | ^~~~~~
s188941945
p00002
C++
#include <iostream> #include <string> using namespace std; int main(){ int tmp,tmp2; cin >> tmp >> tmp2; tmp += tmp2; cout << to_string(tmp).length << endl; return 0; }
a.cc: In function 'int main()': a.cc:10:8: error: invalid use of non-static member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 10 | cout << to_string(tmp).length << endl; | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:54, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/basic_string.h:1083:7: note: declared here 1083 | length() const _GLIBCXX_NOEXCEPT | ^~~~~~
s493652067
p00002
C++
#include <iostream> using namespace std; int main(void){ int a,b = 1; int ans,line = 0; while(std::cin >>a>>b;){ ans = a + b; ans /= 10; if(ans <= 9){ ans = 2; } else if(ans <= 99){ ans = 3; } else if(ans <= 999){ ans = 4; } std::cout << ans << std::endl; } return 0; }
a.cc: In function 'int main()': a.cc:7:26: error: expected ')' before ';' token 7 | while(std::cin >>a>>b;){ | ~ ^ | ) a.cc:7:27: error: expected primary-expression before ')' token 7 | while(std::cin >>a>>b;){ | ^
s916645228
p00002
C++
#include<stdio.h> #include<math.h> int main(){ int a,b,c,d; while(scanf("%d %d", &a, &b) != EOF){ c=(int)log10(a+b)+1; printf("%d\n",c); } return 0;
a.cc: In function 'int main()': a.cc:9:10: error: expected '}' at end of input 9 | return 0; | ^ a.cc:3:11: note: to match this '{' 3 | int main(){ | ^
s664373385
p00002
C++
#include <iostream> using namespace std; int main() { int a, b; while (cin >> a >> b) { int sum = a + b; #if 0 int n; for (n = 0; sum > 0; n++) { sum /= 10; } cout << n << endl; #else if (n > 10000000) { n = 8; } } else if (n > 1000000) { n = 7; } } else if (n > 100000) { n = 6; } } else if (n > 10000) { n = 5; } } else if (n > 1000) { n = 4; } } else if (n > 100) { n = 3; } } else if (n > 10) { n = 2; } } else if (n > 1) { n = 1; } } else { n = 0; } #endif } return 0; }
a.cc: In function 'int main()': a.cc:18:28: error: 'n' was not declared in this scope 18 | if (n > 10000000) { n = 8; } | ^ a.cc:19:19: error: 'else' without a previous 'if' 19 | } else if (n > 1000000) { n = 7; } | ^~~~ a.cc:19:28: error: 'n' was not declared in this scope 19 | } else if (n > 1000000) { n = 7; } | ^ a.cc: At global scope: a.cc:20:19: error: expected unqualified-id before 'else' 20 | } else if (n > 100000) { n = 6; } | ^~~~ a.cc:21:17: error: expected declaration before '}' token 21 | } else if (n > 10000) { n = 5; } | ^ a.cc:21:19: error: expected unqualified-id before 'else' 21 | } else if (n > 10000) { n = 5; } | ^~~~ a.cc:22:17: error: expected declaration before '}' token 22 | } else if (n > 1000) { n = 4; } | ^ a.cc:22:19: error: expected unqualified-id before 'else' 22 | } else if (n > 1000) { n = 4; } | ^~~~ a.cc:23:17: error: expected declaration before '}' token 23 | } else if (n > 100) { n = 3; } | ^ a.cc:23:19: error: expected unqualified-id before 'else' 23 | } else if (n > 100) { n = 3; } | ^~~~ a.cc:24:17: error: expected declaration before '}' token 24 | } else if (n > 10) { n = 2; } | ^ a.cc:24:19: error: expected unqualified-id before 'else' 24 | } else if (n > 10) { n = 2; } | ^~~~ a.cc:25:17: error: expected declaration before '}' token 25 | } else if (n > 1) { n = 1; } | ^ a.cc:25:19: error: expected unqualified-id before 'else' 25 | } else if (n > 1) { n = 1; } | ^~~~ a.cc:26:17: error: expected declaration before '}' token 26 | } else { n = 0; | ^ a.cc:26:19: error: expected unqualified-id before 'else' 26 | } else { n = 0; | ^~~~ a.cc:30:9: error: expected declaration before '}' token 30 | } | ^ a.cc:31:9: error: expected unqualified-id before 'return' 31 | return 0; | ^~~~~~ a.cc:32:1: error: expected declaration before '}' token 32 | } | ^
s209930982
p00002
C++
#include <iostream> using namespace std; int main() { int a, b; while (cin >> a >> b) { cout << static_cast<int>(log10(a + b) + 1) << endl; } return 0; }
a.cc: In function 'int main()': a.cc:8:34: error: 'log10' was not declared in this scope 8 | cout << static_cast<int>(log10(a + b) + 1) << endl; | ^~~~~
s309093215
p00002
C++
#include<stdio.h> int main() { int a,b,c=1,d=1; while(scanf("%d%d",&a,&b) != EOF { while(c<=a+b) { c*=10; d++; } printf("%d\n",d); } return 0; }
a.cc: In function 'int main()': a.cc:6:1: error: expected ')' before '{' token 6 | { | ^ a.cc:5:8: note: to match this '(' 5 | while(scanf("%d%d",&a,&b) != EOF | ^
s962672305
p00002
C++
#include <bits/stdc++.h> using namespace std; int a; int b; int main() { while (cin >> a >> b ; != EOF) { int i; a = a + b; while(a > 0) { a = a / 10; ++i; } cout << i << endl; } }
a.cc: In function 'int main()': a.cc:8:23: error: expected ')' before ';' token 8 | while (cin >> a >> b ; != EOF) { | ~ ^~ | ) a.cc:8:26: error: expected primary-expression before '!=' token 8 | while (cin >> a >> b ; != EOF) { | ^~
s115103170
p00002
C++
#include <bits/stdc++.h> using namespace std; int a; int b; int main() { while (cin >> a >> b , != EOF) { int i; a = a + b; while(a > 0) { a = a / 10; ++i; } cout << i << endl; } }
a.cc: In function 'int main()': a.cc:8:26: error: expected primary-expression before '!=' token 8 | while (cin >> a >> b , != EOF) { | ^~