submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s918735693
p03844
C++
#include <iostream> #include <string> #include <vector> #include <algorithm> using namespace std; int main(void){ int a, b; string op; cin >> a >> op >> b; cout << op=="+" ? a+b : a-b << endl; return 0; }
a.cc: In function 'int main()': a.cc:12:19: error: no match for 'operator==' (operand types are 'std::basic_ostream<char>' and 'const char [2]') 12 | cout << op=="+" ? a+b : a-b << endl; | ~~~~~~~~~~^~~~~ | | | | | const char [2] | std::basic_ostream<char> 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:1: /usr/include/c++/14/bits/postypes.h:192:5: note: candidate: 'template<class _StateT> bool std::operator==(const fpos<_StateT>&, const fpos<_StateT>&)' 192 | operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/postypes.h:192:5: note: template argument deduction/substitution failed: a.cc:12:21: note: 'std::basic_ostream<char>' is not derived from 'const std::fpos<_StateT>' 12 | cout << op=="+" ? a+b : a-b << endl; | ^~~ 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:235:5: note: candidate: 'template<class _T1, class _T2> bool std::operator==(const allocator<_CharT>&, const allocator<_T2>&)' 235 | operator==(const allocator<_T1>&, const allocator<_T2>&) | ^~~~~~~~ /usr/include/c++/14/bits/allocator.h:235:5: note: template argument deduction/substitution failed: a.cc:12:21: note: 'std::basic_ostream<char>' is not derived from 'const std::allocator<_CharT>' 12 | cout << op=="+" ? a+b : a-b << endl; | ^~~ In file included from /usr/include/c++/14/string:48: /usr/include/c++/14/bits/stl_iterator.h:441:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 441 | operator==(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:441:5: note: template argument deduction/substitution failed: a.cc:12:21: note: 'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>' 12 | cout << op=="+" ? a+b : a-b << endl; | ^~~ /usr/include/c++/14/bits/stl_iterator.h:486:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 486 | operator==(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:486:5: note: template argument deduction/substitution failed: a.cc:12:21: note: 'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>' 12 | cout << op=="+" ? a+b : a-b << endl; | ^~~ /usr/include/c++/14/bits/stl_iterator.h:1667:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1667 | operator==(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1667:5: note: template argument deduction/substitution failed: a.cc:12:21: note: 'std::basic_ostream<char>' is not derived from 'const std::move_iterator<_IteratorL>' 12 | cout << op=="+" ? a+b : a-b << endl; | ^~~ /usr/include/c++/14/bits/stl_iterator.h:1737:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1737 | operator==(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1737:5: note: template argument deduction/substitution failed: a.cc:12:21: note: 'std::basic_ostream<char>' is not derived from 'const std::move_iterator<_IteratorL>' 12 | cout << op=="+" ? a+b : a-b << endl; | ^~~ 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:1033:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator==(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1033 | operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1033:5: note: template argument deduction/substitution failed: a.cc:12:21: note: 'std::basic_ostream<char>' is not derived from 'const std::pair<_T1, _T2>' 12 | cout << op=="+" ? a+b : a-b << endl; | ^~~ 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:629: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> >)' 629 | operator==(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:629:5: note: template argument deduction/substitution failed: a.cc:12:21: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 12 | cout << op=="+" ? a+b : a-b << endl; | ^~~ /usr/include/c++/14/string_view:637:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator==(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 637 | operator==(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:637:5: note: template argument deduction/substitution failed: a.cc:12:21: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 12 | cout << op=="+" ? a+b : a-b << endl; | ^~~ /usr/include/c++/14/string_view:644: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>)' 644 | operator==(__type_identity_t<basic_string_view<_CharT, _Traits>> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:644:5: note: template argument deduction/substitution failed: a.cc:12:21: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'const char*' 12 | cout << op=="+" ? a+b : a-b << endl; | ^~~ /usr/include/c++/14/bits/basic_string.h:3755: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>&)' 3755 | operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3755:5: note: template argument deduction/substitution failed: a.cc:12:21: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 12 | cout << op=="+" ? a+b : a-b << endl; | ^~~ /usr/include/c++/14/bits/basic_string.h:3772:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 3772 | operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3772:5: note: template argument deduction/substitution failed: a.cc:12:21: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 12 | cout << op=="+" ? a+b : a-b << endl; | ^~~ /usr/include/c++/14/bits/basic_string.h:3819:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3819 | operator==(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3819:5: note: template argument deduction/substitution failed: a.cc:12:21: note: mismatched types 'const _CharT*' and 'std::basic_ostream<char>' 12 | cout << op=="+" ? a+b : a-b << endl; | ^~~ 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:2558:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator==(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)' 2558 | operator==(const tuple<_TElements...>& __t, | ^~~~~~~~ /usr/include/c++/14/tuple:2558:5: note: template argument deduction/substitution failed: a.cc:12:21: note: 'std::basic_ostream<char>' is not derived from 'const std::tuple<_UTypes ...>' 12 | cout << op=="+" ? a+b : a-b << endl; | ^~~ In file included from /usr/include/c++/14/bits/locale_facets.h:48, from /usr/include/c++/14/bits/basic_ios.h:37, from /usr/include/c++/14/ios:46: /usr/include/c++/14/bits/streambuf_iterator.h:234:5: note: candidate: 'template<class _CharT, class _Traits> bool std::operator==(const istreambuf_iterator<_CharT, _Traits>&, const istreambuf_iterator<_CharT, _Traits>&)' 234 | operator==(const istreambuf_iterator<_CharT, _Traits>& __a, | ^~~~~~~~ /usr/include/c++/14/bits/streambuf_iterator.h:234:5: note: template argument deduction/substitution failed: a.cc:12:21: note: 'std::basic_ostream<char>' is not derived from 'const std::istreambuf_iterator<_CharT, _Traits>' 12 | cout << op=="+" ? a+b : a-b << endl; | ^~~ In file included from /usr/include/c++/14/vector:66, from a.cc
s104497868
p03844
C++
#include <iostream> #include <string> #include <vector> #include <algorithm> using namespace std; int main(void){ int a, b; string op; cin >> a >> op >> b; cout << (op=="+") ? a+b : a-b << endl; return 0; }
a.cc: In function 'int main()': a.cc:12:39: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<' 12 | cout << (op=="+") ? a+b : a-b << endl; | ~~~~^~~~~~~
s187112195
p03844
C++
#include <string> using namespace std; int a , b ; string op ; cin >> a >> op >> b ; if ( op == "+"){ cout << a + b << endl ; }else{ cout << a - b << endl ; }
a.cc:6:3: error: 'cin' does not name a type 6 | cin >> a >> op >> b ; | ^~~ a.cc:7:3: error: expected unqualified-id before 'if' 7 | if ( op == "+"){ | ^~ a.cc:9:4: error: expected unqualified-id before 'else' 9 | }else{ | ^~~~
s907770826
p03844
C++
#include <string> using namespace std; int main() { int a , b ; string op ; cin >> a >> op >> b ; if ( op == "+"){ cout << a + b << endl ; }else{ cout << a - b << endl ; } }
a.cc: In function 'int main()': a.cc:6:3: error: 'cin' was not declared in this scope 6 | cin >> a >> op >> b ; | ^~~ a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 1 | #include <string> +++ |+#include <iostream> 2 | using namespace std; a.cc:8:5: error: 'cout' was not declared in this scope 8 | cout << a + b << endl ; | ^~~~ a.cc:8:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:8:22: error: 'endl' was not declared in this scope 8 | cout << a + b << endl ; | ^~~~ a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' 1 | #include <string> +++ |+#include <ostream> 2 | using namespace std; a.cc:10:5: error: 'cout' was not declared in this scope 10 | cout << a - b << endl ; | ^~~~ a.cc:10:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:10:22: error: 'endl' was not declared in this scope 10 | cout << a - b << endl ; | ^~~~ a.cc:10:22: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
s516186938
p03844
C++
#include <string> using namespace std; int main() { int a , b ; string op ; cin >> a >> op >> b ; if ( op == "+") cout << a + b << endl ; else cout << a - b << endl ; }
a.cc: In function 'int main()': a.cc:6:1: error: 'cin' was not declared in this scope 6 | cin >> a >> op >> b ; | ^~~ a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 1 | #include <string> +++ |+#include <iostream> 2 | using namespace std; a.cc:8:3: error: 'cout' was not declared in this scope 8 | cout << a + b << endl ; | ^~~~ a.cc:8:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:8:20: error: 'endl' was not declared in this scope 8 | cout << a + b << endl ; | ^~~~ a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' 1 | #include <string> +++ |+#include <ostream> 2 | using namespace std; a.cc:10:3: error: 'cout' was not declared in this scope 10 | cout << a - b << endl ; | ^~~~ a.cc:10:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:10:20: error: 'endl' was not declared in this scope 10 | cout << a - b << endl ; | ^~~~ a.cc:10:20: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
s060189388
p03844
C++
#include <string> using namespace std; int a , b ; string op ; cin >> a >> op >> b ; if ( op == "+") cout << a + b << endl ; else cout << a - b << endl ;
a.cc:5:1: error: 'cin' does not name a type 5 | cin >> a >> op >> b ; | ^~~ a.cc:6:1: error: expected unqualified-id before 'if' 6 | if ( op == "+") | ^~ a.cc:8:1: error: expected unqualified-id before 'else' 8 | else | ^~~~
s991058479
p03844
C++
#include <string> using namespace std; int a , b ; string op ; cin >> a >> op >> b ; if ( op == "+") { cout << a + b << endl ; } else { cout << a - b << endl ; }
a.cc:5:1: error: 'cin' does not name a type 5 | cin >> a >> op >> b ; | ^~~ a.cc:6:1: error: expected unqualified-id before 'if' 6 | if ( op == "+") | ^~ a.cc:10:1: error: expected unqualified-id before 'else' 10 | else | ^~~~
s587089589
p03844
C++
#include <string> using namespace std; int a , b ; string op ; cin >> a >> op >> b ; if ( op == "+") cout << a + b << endl ; else cout << a - b << endl ;
a.cc:5:1: error: 'cin' does not name a type 5 | cin >> a >> op >> b ; | ^~~ a.cc:6:1: error: expected unqualified-id before 'if' 6 | if ( op == "+") | ^~ a.cc:8:1: error: expected unqualified-id before 'else' 8 | else | ^~~~
s057076050
p03844
C++
int a , b ; string op ; cin >> a >> op >> b ; if ( op == "+") cout << a + b << endl ; else cout << a - b << endl ;
a.cc:2:1: error: 'string' does not name a type 2 | string op ; | ^~~~~~ a.cc:3:1: error: 'cin' does not name a type 3 | cin >> a >> op >> b ; | ^~~ a.cc:4:1: error: expected unqualified-id before 'if' 4 | if ( op == "+") | ^~ a.cc:6:1: error: expected unqualified-id before 'else' 6 | else | ^~~~
s302877582
p03844
C++
#include <iostream> using namespace std; int main() { int a , b ; string op ; cin > > a >> op >> b ; if ( op == "+") cout << a + b << endl ; else cout << a - b << endl ; }
a.cc: In function 'int main()': a.cc:6:9: error: expected primary-expression before '>' token 6 | cin > > a >> op >> b ; | ^ a.cc:6:13: error: no match for 'operator>>' (operand types are 'int' and 'std::string' {aka 'std::__cxx11::basic_string<char>'}) 6 | cin > > a >> op >> b ; | ~ ^~ ~~ | | | | int std::string {aka std::__cxx11::basic_string<char>} In file included from /usr/include/c++/14/string:55, 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.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:6:16: note: mismatched types 'std::basic_istream<_CharT, _Traits>' and 'int' 6 | cin > > a >> op >> 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:6:11: note: cannot convert 'a' (type 'int') to type 'std::byte' 6 | cin > > a >> op >> b ; | ^ In file included from /usr/include/c++/14/istream:1109, from /usr/include/c++/14/iostream:42: /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:6:16: note: mismatched types 'std::basic_istream<_CharT, _Traits>' and 'int' 6 | cin > > a >> op >> 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:6:16: note: mismatched types 'std::basic_istream<char, _Traits>' and 'int' 6 | cin > > a >> op >> 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:6:16: note: mismatched types 'std::basic_istream<char, _Traits>' and 'int' 6 | cin > > a >> op >> 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:6:16: note: mismatched types 'std::basic_istream<_CharT, _Traits>' and 'int' 6 | cin > > a >> op >> 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:6:16: note: mismatched types 'std::basic_istream<char, _Traits>' and 'int' 6 | cin > > a >> op >> 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:6:16: note: mismatched types 'std::basic_istream<char, _Traits>' and 'int' 6 | cin > > a >> op >> 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 = int&; _Tp = std::__cxx11::basic_string<char>&]': a.cc:6:16: required from here 6 | cin > > a >> op >> 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) | ^~~~~~~~
s817607804
p03844
C++
#include <iostream> using namespace std; int main() { int a , b ; string op ; cin > > a >> op >> b ; if ( op == "+") cout << a + b << endl ; else cout << a - b << endl ; }
a.cc: In function 'int main()': a.cc:6:9: error: expected primary-expression before '>' token 6 | cin > > a >> op >> b ; | ^ a.cc:6:13: error: no match for 'operator>>' (operand types are 'int' and 'std::string' {aka 'std::__cxx11::basic_string<char>'}) 6 | cin > > a >> op >> b ; | ~ ^~ ~~ | | | | int std::string {aka std::__cxx11::basic_string<char>} In file included from /usr/include/c++/14/string:55, 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.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:6:16: note: mismatched types 'std::basic_istream<_CharT, _Traits>' and 'int' 6 | cin > > a >> op >> 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:6:11: note: cannot convert 'a' (type 'int') to type 'std::byte' 6 | cin > > a >> op >> b ; | ^ In file included from /usr/include/c++/14/istream:1109, from /usr/include/c++/14/iostream:42: /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:6:16: note: mismatched types 'std::basic_istream<_CharT, _Traits>' and 'int' 6 | cin > > a >> op >> 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:6:16: note: mismatched types 'std::basic_istream<char, _Traits>' and 'int' 6 | cin > > a >> op >> 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:6:16: note: mismatched types 'std::basic_istream<char, _Traits>' and 'int' 6 | cin > > a >> op >> 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:6:16: note: mismatched types 'std::basic_istream<_CharT, _Traits>' and 'int' 6 | cin > > a >> op >> 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:6:16: note: mismatched types 'std::basic_istream<char, _Traits>' and 'int' 6 | cin > > a >> op >> 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:6:16: note: mismatched types 'std::basic_istream<char, _Traits>' and 'int' 6 | cin > > a >> op >> 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 = int&; _Tp = std::__cxx11::basic_string<char>&]': a.cc:6:16: required from here 6 | cin > > a >> op >> 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) | ^~~~~~~~
s182763854
p03844
C++
int a , b ; string op ; cin > > a >> op >> b ; if ( op == "+") cout << a + b << endl ; else cout << a - b << endl ;
a.cc:2:1: error: 'string' does not name a type 2 | string op ; | ^~~~~~ a.cc:3:1: error: 'cin' does not name a type 3 | cin > > a >> op >> b ; | ^~~ a.cc:4:1: error: expected unqualified-id before 'if' 4 | if ( op == "+") | ^~ a.cc:6:1: error: expected unqualified-id before 'else' 6 | else | ^~~~
s094403336
p03844
C++
int a , b ; string op ; cin > > a >> op >> b ; if ( op == "+") cout << a + b << endl ; else cout << a - b << endl ;
a.cc:2:1: error: 'string' does not name a type 2 | string op ; | ^~~~~~ a.cc:3:1: error: 'cin' does not name a type 3 | cin > > a >> op >> b ; | ^~~ a.cc:4:1: error: expected unqualified-id before 'if' 4 | if ( op == "+") | ^~ a.cc:6:1: error: expected unqualified-id before 'else' 6 | else | ^~~~
s477035018
p03844
C++
int a,b; string op; cin>> a >> op >> b; if ( op == "+" ) cout<< a + b <<endl; else cout<< a - b <<endl;
a.cc:2:1: error: 'string' does not name a type 2 | string op; | ^~~~~~ a.cc:3:1: error: 'cin' does not name a type 3 | cin>> a >> op >> b; | ^~~ a.cc:4:1: error: expected unqualified-id before 'if' 4 | if ( op == "+" ) | ^~ a.cc:6:1: error: expected unqualified-id before 'else' 6 | else | ^~~~
s087039381
p03844
C++
#include<iostream> using namespace std; int main(void) { int a, b; string op; cin >> a >> op >> b; if (op == '+') cout << a+b << endl; else cout << a-b << endl; }
a.cc: In function 'int main()': a.cc:9:10: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char') 9 | if (op == '+') cout << a+b << endl; | ~~ ^~ ~~~ | | | | | char | std::string {aka std::__cxx11::basic_string<char>} 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:1: /usr/include/c++/14/bits/postypes.h:192:5: note: candidate: 'template<class _StateT> bool std::operator==(const fpos<_StateT>&, const fpos<_StateT>&)' 192 | operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/postypes.h:192:5: note: template argument deduction/substitution failed: a.cc:9:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::fpos<_StateT>' 9 | if (op == '+') cout << a+b << endl; | ^~~ 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:235:5: note: candidate: 'template<class _T1, class _T2> bool std::operator==(const allocator<_CharT>&, const allocator<_T2>&)' 235 | operator==(const allocator<_T1>&, const allocator<_T2>&) | ^~~~~~~~ /usr/include/c++/14/bits/allocator.h:235:5: note: template argument deduction/substitution failed: a.cc:9:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::allocator<_CharT>' 9 | if (op == '+') cout << a+b << endl; | ^~~ In file included from /usr/include/c++/14/string:48: /usr/include/c++/14/bits/stl_iterator.h:441:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 441 | operator==(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:441:5: note: template argument deduction/substitution failed: a.cc:9:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 9 | if (op == '+') cout << a+b << endl; | ^~~ /usr/include/c++/14/bits/stl_iterator.h:486:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 486 | operator==(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:486:5: note: template argument deduction/substitution failed: a.cc:9:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 9 | if (op == '+') cout << a+b << endl; | ^~~ /usr/include/c++/14/bits/stl_iterator.h:1667:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1667 | operator==(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1667:5: note: template argument deduction/substitution failed: a.cc:9:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 9 | if (op == '+') cout << a+b << endl; | ^~~ /usr/include/c++/14/bits/stl_iterator.h:1737:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1737 | operator==(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1737:5: note: template argument deduction/substitution failed: a.cc:9:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 9 | if (op == '+') cout << a+b << endl; | ^~~ 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:1033:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator==(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1033 | operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1033:5: note: template argument deduction/substitution failed: a.cc:9:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>' 9 | if (op == '+') cout << a+b << endl; | ^~~ 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:629: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> >)' 629 | operator==(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:629:5: note: template argument deduction/substitution failed: a.cc:9:13: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 9 | if (op == '+') cout << a+b << endl; | ^~~ /usr/include/c++/14/string_view:637:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator==(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 637 | operator==(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:637:5: note: template argument deduction/substitution failed: a.cc:9:13: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 9 | if (op == '+') cout << a+b << endl; | ^~~ /usr/include/c++/14/string_view:644: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>)' 644 | operator==(__type_identity_t<basic_string_view<_CharT, _Traits>> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:644:5: note: template argument deduction/substitution failed: a.cc:9:13: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'char' 9 | if (op == '+') cout << a+b << endl; | ^~~ /usr/include/c++/14/bits/basic_string.h:3755: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>&)' 3755 | operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3755:5: note: template argument deduction/substitution failed: a.cc:9:13: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'char' 9 | if (op == '+') cout << a+b << endl; | ^~~ /usr/include/c++/14/bits/basic_string.h:3772:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 3772 | operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3772:5: note: template argument deduction/substitution failed: a.cc:9:13: note: mismatched types 'const _CharT*' and 'char' 9 | if (op == '+') cout << a+b << endl; | ^~~ /usr/include/c++/14/bits/basic_string.h:3819:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3819 | operator==(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3819:5: note: template argument deduction/substitution failed: a.cc:9:13: note: mismatched types 'const _CharT*' and 'std::__cxx11::basic_string<char>' 9 | if (op == '+') cout << a+b << endl; | ^~~ 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:2558:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator==(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)' 2558 | operator==(const tuple<_TElements...>& __t, | ^~~~~~~~ /usr/include/c++/14/tuple:2558:5: note: template argument deduction/substitution failed: a.cc:9:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::tuple<_UTypes ...>' 9 | if (op == '+') cout << a+b << endl; | ^~~ In file included from /usr/include/c++/14/bits/locale_facets.h:48, from /usr/include/c++/14/bits/basic_ios.h:37, from /usr/include/c++/14/ios:46: /usr/include/c++/14/bits/streambuf_iterator.h:234:5: note: candidate: 'template<class _CharT, class _Traits> bool std::operator==(const istreambuf_iterator<_CharT, _Traits>&, const istreambuf_iterator<_CharT, _Traits>&)' 234 | operator==(const istreambuf_iterator<_CharT, _Traits>& __a, | ^~~~~~~~ /usr/include/c++/14/bits/streambuf_iterator.h:234:5: note: template argument deduction/substitution failed: a.cc:9:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::istreambuf_iterator<_CharT, _Traits>' 9 | if (op == '+') cout << a+b << endl; | ^~~ In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/c++allocator.h:33, from /usr/include/c++/14/bits/allocator.h
s481625248
p03844
C++
#include<cstdio> using namespace std; inline int read(){ char ch=getchar(); int x=0; while(ch<'0'||ch>'9') ch=getchar(); while(ch>='0'&&ch<='9') x=x*10+(ch^48),ch=getchar(); return x; } int main(){ bool f=0; int a=read(); if(getchar();=='+') f=1; int b=read(); if(f) printf("%d",a+b); else printf("%d",a-b); putchar('\n'); return 0; }
a.cc: In function 'int main()': a.cc:13:22: error: expected primary-expression before '==' token 13 | if(getchar();=='+') f=1; | ^~
s241911101
p03844
C++
#include<bits/stdc++.h> using namespace std; int main() { int a,b; char fh; cin>>a>fh>>b; if(fh=='+') cout<<a+b<<endl; else cout<<a-b<<endl; return 0; }
a.cc: In function 'int main()': a.cc:7:15: error: no match for 'operator>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'int') 7 | cin>>a>fh>>b; | ~~~~~~^~~~~~ | | | | | int | std::basic_istream<char>::__istream_type {aka std::basic_istream<char>} a.cc:7:15: note: candidate: 'operator>(int, int)' (built-in) 7 | cin>>a>fh>>b; | ~~~~~~^~~~~~ a.cc:7:15: 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/regex:68, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181, from a.cc:1: /usr/include/c++/14/bits/regex.h:1176:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator>(const sub_match<_BiIter>&, const sub_match<_BiIter>&)' 1176 | operator>(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1176:5: note: template argument deduction/substitution failed: a.cc:7:20: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 7 | cin>>a>fh>>b; | ^ /usr/include/c++/14/bits/regex.h:1236:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator>(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)' 1236 | operator>(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1236:5: note: template argument deduction/substitution failed: a.cc:7:20: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>' 7 | cin>>a>fh>>b; | ^ /usr/include/c++/14/bits/regex.h:1329:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator>(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)' 1329 | operator>(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1329:5: note: template argument deduction/substitution failed: a.cc:7:20: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 7 | cin>>a>fh>>b; | ^ /usr/include/c++/14/bits/regex.h:1403:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator>(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)' 1403 | operator>(typename iterator_traits<_Bi_iter>::value_type const* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1403:5: note: template argument deduction/substitution failed: a.cc:7:20: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 7 | cin>>a>fh>>b; | ^ /usr/include/c++/14/bits/regex.h:1497:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator>(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)' 1497 | operator>(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1497:5: note: template argument deduction/substitution failed: a.cc:7:20: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 7 | cin>>a>fh>>b; | ^ /usr/include/c++/14/bits/regex.h:1573:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator>(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)' 1573 | operator>(typename iterator_traits<_Bi_iter>::value_type const& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1573:5: note: template argument deduction/substitution failed: a.cc:7:20: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 7 | cin>>a>fh>>b; | ^ /usr/include/c++/14/bits/regex.h:1673:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator>(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)' 1673 | operator>(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1673:5: note: template argument deduction/substitution failed: a.cc:7:20: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 7 | cin>>a>fh>>b; | ^ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51: /usr/include/c++/14/bits/stl_pair.h:1058:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator>(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1058 | operator>(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1058:5: note: template argument deduction/substitution failed: a.cc:7:20: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::pair<_T1, _T2>' 7 | cin>>a>fh>>b; | ^ In file included from /usr/include/c++/14/bits/stl_algobase.h:67: /usr/include/c++/14/bits/stl_iterator.h:462:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator>(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 462 | operator>(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:462:5: note: template argument deduction/substitution failed: a.cc:7:20: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 7 | cin>>a>fh>>b; | ^ /usr/include/c++/14/bits/stl_iterator.h:507:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator>(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 507 | operator>(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:507:5: note: template argument deduction/substitution failed: a.cc:7:20: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 7 | cin>>a>fh>>b; | ^ /usr/include/c++/14/bits/stl_iterator.h:1714:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator>(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1714 | operator>(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1714:5: note: template argument deduction/substitution failed: a.cc:7:20: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 7 | cin>>a>fh>>b; | ^ /usr/include/c++/14/bits/stl_iterator.h:1774:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator>(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1774 | operator>(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1774:5: note: template argument deduction/substitution failed: a.cc:7:20: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 7 | cin>>a>fh>>b; | ^ In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/string_view:695:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator>(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 695 | operator> (basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:695:5: note: template argument deduction/substitution failed: a.cc:7:20: note: 'std::basic_istream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 7 | cin>>a>fh>>b; | ^ /usr/include/c++/14/string_view:702: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> >)' 702 | operator> (basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:702:5: note: template argument deduction/substitution failed: a.cc:7:20: note: 'std::basic_istream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 7 | cin>>a>fh>>b; | ^ /usr/include/c++/14/string_view:710: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>)' 710 | operator> (__type_identity_t<basic_string_view<_CharT, _Traits>> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:710:5: note: template argument deduction/substitution failed: a.cc:7:20: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int' 7 | cin>>a>fh>>b; | ^ /usr/include/c++/14/bits/basic_string.h:3915:5: note: candidate: 'template<class _CharT, class _Traits, c
s266239503
p03844
C++
#include <iostream> #include <array> #include <math.h> using namespace std; int main() { int n; cin >> n; int ls[n]; for (int i = 0; i < n; i++) { cin >> ls[i]; } sort(ls, ls + n); if (n % 2 == 0) { int count = 1; for (int i = 0; i < n; i++) { if(ls[i] != count) { cout << 0; return 0; } if (i % 2 != 0) { count += 2; } } cout << fmod(pow(2, n / 2), 1000000000 + 7); return 0; } else { if (ls[0] != 0) { cout << 0; return 0; } int count = 2; for (int i = 1; i < n; i++) { if(ls[i] != count) { cout << 0; return 0; } if (i % 2 == 0) { count += 2; } } cout << fmod(pow(2, (n - 1) / 2), 1000000000 + 7); } return 0; }
a.cc: In function 'int main()': a.cc:15:5: error: 'sort' was not declared in this scope; did you mean 'sqrt'? 15 | sort(ls, ls + n); | ^~~~ | sqrt
s951915058
p03844
C++
#include <iostream> using namespace std; int main() { int a, b, op; cin >> a >>op >> b; cout << (a op b) << endl; }
a.cc: In function 'int main()': a.cc:8:13: error: expected ')' before 'op' 8 | cout << (a op b) << endl; | ~ ^~~ | )
s157505531
p03844
C++
#include<bits/stdc++.h> using namespace std; long long a,b; string fuhao; int main() { cin>>a>>fuhao>>b; if(fuhao=='+')cout<<a+b<<endl; if(fuhao=='-')cout<<a-b<<endl; if(fuhao=='*')cout<<a*b<<endl; if(fuhao=='/')cout<<a/b<<endl; return 0; }
a.cc: In function 'int main()': a.cc:9:10: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char') 9 | if(fuhao=='+')cout<<a+b<<endl; | ~~~~~^~~~~ | | | | | char | std::string {aka std::__cxx11::basic_string<char>} In file included from /usr/include/c++/14/regex:68, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181, from a.cc:1: /usr/include/c++/14/bits/regex.h:1103:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const sub_match<_BiIter>&)' 1103 | operator==(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1103:5: note: template argument deduction/substitution failed: a.cc:9:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 9 | if(fuhao=='+')cout<<a+b<<endl; | ^~~ /usr/include/c++/14/bits/regex.h:1199:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator==(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)' 1199 | operator==(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1199:5: note: template argument deduction/substitution failed: a.cc:9:12: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char' 9 | if(fuhao=='+')cout<<a+b<<endl; | ^~~ /usr/include/c++/14/bits/regex.h:1274:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator==(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)' 1274 | operator==(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1274:5: note: template argument deduction/substitution failed: a.cc:9:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 9 | if(fuhao=='+')cout<<a+b<<endl; | ^~~ /usr/include/c++/14/bits/regex.h:1366:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)' 1366 | operator==(typename iterator_traits<_Bi_iter>::value_type const* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1366:5: note: template argument deduction/substitution failed: a.cc:9:12: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char' 9 | if(fuhao=='+')cout<<a+b<<endl; | ^~~ /usr/include/c++/14/bits/regex.h:1441:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)' 1441 | operator==(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1441:5: note: template argument deduction/substitution failed: a.cc:9:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 9 | if(fuhao=='+')cout<<a+b<<endl; | ^~~ /usr/include/c++/14/bits/regex.h:1534:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)' 1534 | operator==(typename iterator_traits<_Bi_iter>::value_type const& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1534:5: note: template argument deduction/substitution failed: a.cc:9:12: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char' 9 | if(fuhao=='+')cout<<a+b<<endl; | ^~~ /usr/include/c++/14/bits/regex.h:1613:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)' 1613 | operator==(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1613:5: note: template argument deduction/substitution failed: a.cc:9:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 9 | if(fuhao=='+')cout<<a+b<<endl; | ^~~ /usr/include/c++/14/bits/regex.h:2186:5: note: candidate: 'template<class _Bi_iter, class _Alloc> bool std::__cxx11::operator==(const match_results<_BiIter, _Alloc>&, const match_results<_BiIter, _Alloc>&)' 2186 | operator==(const match_results<_Bi_iter, _Alloc>& __m1, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:2186:5: note: template argument deduction/substitution failed: a.cc:9:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::match_results<_BiIter, _Alloc>' 9 | if(fuhao=='+')cout<<a+b<<endl; | ^~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51: /usr/include/c++/14/bits/stl_pair.h:1033:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator==(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1033 | operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1033:5: note: template argument deduction/substitution failed: a.cc:9:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>' 9 | if(fuhao=='+')cout<<a+b<<endl; | ^~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:67: /usr/include/c++/14/bits/stl_iterator.h:441:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 441 | operator==(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:441:5: note: template argument deduction/substitution failed: a.cc:9:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 9 | if(fuhao=='+')cout<<a+b<<endl; | ^~~ /usr/include/c++/14/bits/stl_iterator.h:486:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 486 | operator==(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:486:5: note: template argument deduction/substitution failed: a.cc:9:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 9 | if(fuhao=='+')cout<<a+b<<endl; | ^~~ /usr/include/c++/14/bits/stl_iterator.h:1667:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1667 | operator==(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1667:5: note: template argument deduction/substitution failed: a.cc:9:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 9 | if(fuhao=='+')cout<<a+b<<endl; | ^~~ /usr/include/c++/14/bits/stl_iterator.h:1737:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1737 | operator==(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1737:5: note: template argument deduction/substitution failed: a.cc:9:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 9 | if(fuhao=='+')cout<<a+b<<endl; | ^~~ In file included from /usr/include/c++/14/bits/char_traits.h:42, from /usr/include/c++/14/string:42, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/bits/postypes.h:192:5: note: candidate: 'template<class _StateT> bool std::operator==(const fpos<_StateT>&, const fpos<_StateT>&)' 192 | operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/postypes.h:192:5: note: template argument deduction/substitution failed: a.cc:9:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::fpos<_StateT>' 9 | if(fuhao=='+')cout<<a+b<<endl; | ^~~ In file included from /usr/include/c++/14/string:43: /usr/include/c++/14/bits/allocator.h:235:5: note: candidate: 'template<class _T1, class _T2> bool std::operator==(const allocator<_CharT>&, const allocator<_T2>&)' 235 | operator==(const allocator<_T1>&, const allocator<_T2>&) | ^~~~~~~~ /usr/include/c++/14/bits/allocator.h:235:5: note: template argument deduction/substitution failed: a.cc:9:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::allocator<_CharT>' 9 | if(fuhao=='+')cout<<a+b<<endl; | ^~~ 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:629: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> >)' 629 | operator==(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:629:5: note: template argument deduction/substitution failed: a.cc:9:12: note: 'std::__cxx11::basic_string<char>' i
s253597605
p03844
C++
#include<bits/stdc++.h> using namespace std; long long a,b; string fuhao; int main() { cin>>a>>fuhao>>b; if(fuhao=='+')cout<<a+b<<endl; if(fuhao=='-')cout<<a-b<<endl; if(fuhao=='*')cout<<a*b<<endl; if(fuhao=='/')cout<<a/b<<endl; return 0; }
a.cc: In function 'int main()': a.cc:9:10: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char') 9 | if(fuhao=='+')cout<<a+b<<endl; | ~~~~~^~~~~ | | | | | char | std::string {aka std::__cxx11::basic_string<char>} In file included from /usr/include/c++/14/regex:68, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181, from a.cc:1: /usr/include/c++/14/bits/regex.h:1103:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const sub_match<_BiIter>&)' 1103 | operator==(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1103:5: note: template argument deduction/substitution failed: a.cc:9:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 9 | if(fuhao=='+')cout<<a+b<<endl; | ^~~ /usr/include/c++/14/bits/regex.h:1199:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator==(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)' 1199 | operator==(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1199:5: note: template argument deduction/substitution failed: a.cc:9:12: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char' 9 | if(fuhao=='+')cout<<a+b<<endl; | ^~~ /usr/include/c++/14/bits/regex.h:1274:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator==(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)' 1274 | operator==(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1274:5: note: template argument deduction/substitution failed: a.cc:9:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 9 | if(fuhao=='+')cout<<a+b<<endl; | ^~~ /usr/include/c++/14/bits/regex.h:1366:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)' 1366 | operator==(typename iterator_traits<_Bi_iter>::value_type const* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1366:5: note: template argument deduction/substitution failed: a.cc:9:12: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char' 9 | if(fuhao=='+')cout<<a+b<<endl; | ^~~ /usr/include/c++/14/bits/regex.h:1441:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)' 1441 | operator==(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1441:5: note: template argument deduction/substitution failed: a.cc:9:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 9 | if(fuhao=='+')cout<<a+b<<endl; | ^~~ /usr/include/c++/14/bits/regex.h:1534:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)' 1534 | operator==(typename iterator_traits<_Bi_iter>::value_type const& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1534:5: note: template argument deduction/substitution failed: a.cc:9:12: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char' 9 | if(fuhao=='+')cout<<a+b<<endl; | ^~~ /usr/include/c++/14/bits/regex.h:1613:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)' 1613 | operator==(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1613:5: note: template argument deduction/substitution failed: a.cc:9:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 9 | if(fuhao=='+')cout<<a+b<<endl; | ^~~ /usr/include/c++/14/bits/regex.h:2186:5: note: candidate: 'template<class _Bi_iter, class _Alloc> bool std::__cxx11::operator==(const match_results<_BiIter, _Alloc>&, const match_results<_BiIter, _Alloc>&)' 2186 | operator==(const match_results<_Bi_iter, _Alloc>& __m1, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:2186:5: note: template argument deduction/substitution failed: a.cc:9:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::match_results<_BiIter, _Alloc>' 9 | if(fuhao=='+')cout<<a+b<<endl; | ^~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51: /usr/include/c++/14/bits/stl_pair.h:1033:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator==(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1033 | operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1033:5: note: template argument deduction/substitution failed: a.cc:9:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>' 9 | if(fuhao=='+')cout<<a+b<<endl; | ^~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:67: /usr/include/c++/14/bits/stl_iterator.h:441:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 441 | operator==(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:441:5: note: template argument deduction/substitution failed: a.cc:9:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 9 | if(fuhao=='+')cout<<a+b<<endl; | ^~~ /usr/include/c++/14/bits/stl_iterator.h:486:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 486 | operator==(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:486:5: note: template argument deduction/substitution failed: a.cc:9:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 9 | if(fuhao=='+')cout<<a+b<<endl; | ^~~ /usr/include/c++/14/bits/stl_iterator.h:1667:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1667 | operator==(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1667:5: note: template argument deduction/substitution failed: a.cc:9:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 9 | if(fuhao=='+')cout<<a+b<<endl; | ^~~ /usr/include/c++/14/bits/stl_iterator.h:1737:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1737 | operator==(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1737:5: note: template argument deduction/substitution failed: a.cc:9:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 9 | if(fuhao=='+')cout<<a+b<<endl; | ^~~ In file included from /usr/include/c++/14/bits/char_traits.h:42, from /usr/include/c++/14/string:42, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/bits/postypes.h:192:5: note: candidate: 'template<class _StateT> bool std::operator==(const fpos<_StateT>&, const fpos<_StateT>&)' 192 | operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/postypes.h:192:5: note: template argument deduction/substitution failed: a.cc:9:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::fpos<_StateT>' 9 | if(fuhao=='+')cout<<a+b<<endl; | ^~~ In file included from /usr/include/c++/14/string:43: /usr/include/c++/14/bits/allocator.h:235:5: note: candidate: 'template<class _T1, class _T2> bool std::operator==(const allocator<_CharT>&, const allocator<_T2>&)' 235 | operator==(const allocator<_T1>&, const allocator<_T2>&) | ^~~~~~~~ /usr/include/c++/14/bits/allocator.h:235:5: note: template argument deduction/substitution failed: a.cc:9:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::allocator<_CharT>' 9 | if(fuhao=='+')cout<<a+b<<endl; | ^~~ 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:629: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> >)' 629 | operator==(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:629:5: note: template argument deduction/substitution failed: a.cc:9:12: note: 'std::__cxx11::basic_string<char>' i
s812995722
p03844
C++
#include <bits/stdc++.h> using namespace std; int main() { int a,b; string op; cin >> a >> op >>b; if(op=='+')cout<<a+b<<endl; else cout<<a-b<<endl; }
a.cc: In function 'int main()': a.cc:8:8: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char') 8 | if(op=='+')cout<<a+b<<endl; | ~~^~~~~ | | | | | char | std::string {aka std::__cxx11::basic_string<char>} In file included from /usr/include/c++/14/regex:68, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181, from a.cc:1: /usr/include/c++/14/bits/regex.h:1103:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const sub_match<_BiIter>&)' 1103 | operator==(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1103:5: note: template argument deduction/substitution failed: a.cc:8:10: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 8 | if(op=='+')cout<<a+b<<endl; | ^~~ /usr/include/c++/14/bits/regex.h:1199:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator==(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)' 1199 | operator==(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1199:5: note: template argument deduction/substitution failed: a.cc:8:10: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char' 8 | if(op=='+')cout<<a+b<<endl; | ^~~ /usr/include/c++/14/bits/regex.h:1274:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator==(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)' 1274 | operator==(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1274:5: note: template argument deduction/substitution failed: a.cc:8:10: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 8 | if(op=='+')cout<<a+b<<endl; | ^~~ /usr/include/c++/14/bits/regex.h:1366:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)' 1366 | operator==(typename iterator_traits<_Bi_iter>::value_type const* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1366:5: note: template argument deduction/substitution failed: a.cc:8:10: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char' 8 | if(op=='+')cout<<a+b<<endl; | ^~~ /usr/include/c++/14/bits/regex.h:1441:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)' 1441 | operator==(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1441:5: note: template argument deduction/substitution failed: a.cc:8:10: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 8 | if(op=='+')cout<<a+b<<endl; | ^~~ /usr/include/c++/14/bits/regex.h:1534:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)' 1534 | operator==(typename iterator_traits<_Bi_iter>::value_type const& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1534:5: note: template argument deduction/substitution failed: a.cc:8:10: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char' 8 | if(op=='+')cout<<a+b<<endl; | ^~~ /usr/include/c++/14/bits/regex.h:1613:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)' 1613 | operator==(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1613:5: note: template argument deduction/substitution failed: a.cc:8:10: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 8 | if(op=='+')cout<<a+b<<endl; | ^~~ /usr/include/c++/14/bits/regex.h:2186:5: note: candidate: 'template<class _Bi_iter, class _Alloc> bool std::__cxx11::operator==(const match_results<_BiIter, _Alloc>&, const match_results<_BiIter, _Alloc>&)' 2186 | operator==(const match_results<_Bi_iter, _Alloc>& __m1, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:2186:5: note: template argument deduction/substitution failed: a.cc:8:10: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::match_results<_BiIter, _Alloc>' 8 | if(op=='+')cout<<a+b<<endl; | ^~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51: /usr/include/c++/14/bits/stl_pair.h:1033:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator==(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1033 | operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1033:5: note: template argument deduction/substitution failed: a.cc:8:10: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>' 8 | if(op=='+')cout<<a+b<<endl; | ^~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:67: /usr/include/c++/14/bits/stl_iterator.h:441:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 441 | operator==(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:441:5: note: template argument deduction/substitution failed: a.cc:8:10: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 8 | if(op=='+')cout<<a+b<<endl; | ^~~ /usr/include/c++/14/bits/stl_iterator.h:486:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 486 | operator==(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:486:5: note: template argument deduction/substitution failed: a.cc:8:10: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 8 | if(op=='+')cout<<a+b<<endl; | ^~~ /usr/include/c++/14/bits/stl_iterator.h:1667:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1667 | operator==(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1667:5: note: template argument deduction/substitution failed: a.cc:8:10: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 8 | if(op=='+')cout<<a+b<<endl; | ^~~ /usr/include/c++/14/bits/stl_iterator.h:1737:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1737 | operator==(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1737:5: note: template argument deduction/substitution failed: a.cc:8:10: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 8 | if(op=='+')cout<<a+b<<endl; | ^~~ In file included from /usr/include/c++/14/bits/char_traits.h:42, from /usr/include/c++/14/string:42, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/bits/postypes.h:192:5: note: candidate: 'template<class _StateT> bool std::operator==(const fpos<_StateT>&, const fpos<_StateT>&)' 192 | operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/postypes.h:192:5: note: template argument deduction/substitution failed: a.cc:8:10: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::fpos<_StateT>' 8 | if(op=='+')cout<<a+b<<endl; | ^~~ In file included from /usr/include/c++/14/string:43: /usr/include/c++/14/bits/allocator.h:235:5: note: candidate: 'template<class _T1, class _T2> bool std::operator==(const allocator<_CharT>&, const allocator<_T2>&)' 235 | operator==(const allocator<_T1>&, const allocator<_T2>&) | ^~~~~~~~ /usr/include/c++/14/bits/allocator.h:235:5: note: template argument deduction/substitution failed: a.cc:8:10: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::allocator<_CharT>' 8 | if(op=='+')cout<<a+b<<endl; | ^~~ 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:629: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> >)' 629 | operator==(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:629:5: note: template argument deduction/substitution failed: a.cc:8:10: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 8 |
s765815553
p03844
C++
#include <bits/stdc++.h> using namespace std; int main(){ int a,b; char s; cin>>a>>s>>b; if(s=='+'){ cout<<a+b<<endl; } else{ coiut<<a-b<<endl; } }
a.cc: In function 'int main()': a.cc:12:5: error: 'coiut' was not declared in this scope 12 | coiut<<a-b<<endl; | ^~~~~
s194677189
p03844
C++
#include <bits/stdc++.h> int main(){ int a,b; char s; cin>>a>>s>>b; if(s=='+'){ cout<<a+b<<endl; } else{ coiut<<a-b<<endl; } }
a.cc: In function 'int main()': a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 5 | cin>>a>>s>>b; | ^~~ | std::cin In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146, 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:8:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 8 | cout<<a+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:8:16: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 8 | cout<<a+b<<endl; | ^~~~ | std::endl In file included from /usr/include/c++/14/istream:41, from /usr/include/c++/14/sstream:40, from /usr/include/c++/14/complex:45, from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127: /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~ a.cc:11:5: error: 'coiut' was not declared in this scope 11 | coiut<<a-b<<endl; | ^~~~~ a.cc:11:17: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 11 | coiut<<a-b<<endl; | ^~~~ | std::endl /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
s948420312
p03844
C++
#include<bits/stdc++.h> using namespace std; #define ll long long int #define ld long double #define pb push_back #define boost ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0) #define pii pair<ll,ll> #define forn(i,n) for(int i=0;i<n;i++) #define F first #define S second int main() { boost; ll a,b; char c; cin>>a>>c>>b; if(c=='+') cout<<(long long inr)a+b<<endl; else if(c=='-') { cout<<a-b<<endl; } }
a.cc: In function 'int main()': a.cc:18:14: error: expected primary-expression before 'long' 18 | cout<<(long long inr)a+b<<endl; | ^~~~ a.cc:18:14: error: expected ')' before 'long' 18 | cout<<(long long inr)a+b<<endl; | ~^~~~ | )
s359060688
p03844
C++
#include <iostream> #include <vector> #include <string> #include <algorithm> #include <functional> #include <queue> #include <set> #define rep(i,n) for(int (i)=0;(i)<(n);(i)++) #define rep1(i,n) for(int i=1;i<=(int)(n);i++) using namespace std; typedef long long int lli; int main(){ int A,B; char op; cin>>A>>op>>B; if(op=='+')cout<<A+B; else cout A-B; }
a.cc: In function 'int main()': a.cc:19:18: error: expected ';' before 'A' 19 | else cout A-B; | ^~ | ;
s241927180
p03844
C++
#include<iostream> #include<string> using namespace std; int main (){ int a,b; string op; cin>>a>>op>>b; if(op=="-") { cont<<a-b;} else{ cout<<a+b;} return 0; }
a.cc: In function 'int main()': a.cc:9:1: error: 'cont' was not declared in this scope; did you mean 'const'? 9 | cont<<a-b;} | ^~~~ | const
s918634591
p03844
C++
#include<iostream> #include<string> using namespace std; int main (){ int a,b; string op; cin>>a>>op>>b; if(op=="~") { cont<<a-b;} else{ cout>>a+b;} return 0; }
a.cc: In function 'int main()': a.cc:9:1: error: 'cont' was not declared in this scope; did you mean 'const'? 9 | cont<<a-b;} | ^~~~ | const a.cc:11:5: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int') 11 | cout>>a+b;} | ~~~~^~~~~ | | | | | int | std::ostream {aka std::basic_ostream<char>} a.cc:11:5: note: candidate: 'operator>>(int, int)' (built-in) 11 | cout>>a+b;} | ~~~~^~~~~ a.cc:11:5: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'int' In file included from /usr/include/c++/14/string:55, 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.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:9: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 11 | cout>>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:1: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte' 11 | cout>>a+b;} | ^~~~ In file included from /usr/include/c++/14/istream:1109, from /usr/include/c++/14/iostream:42: /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:9: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 11 | cout>>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:9: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 11 | cout>>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:9: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 11 | cout>>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:9: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 11 | cout>>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:9: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 11 | cout>>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:9: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 11 | cout>>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::basic_ostream<char>&; _Tp = int]': a.cc:11:9: required from here 11 | cout>>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) | ^~~~~~~~
s639369932
p03844
C
#include <stdio.h> a;b;char c; main{ scanf("%d%c%d",&a,&c,&b); if(c-'-')printf("%d\n",a+b); else printf("%d\n",a-b); }
main.c:2:1: warning: data definition has no type or storage class 2 | a;b;char c; | ^ main.c:2:1: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int] main.c:2:3: warning: data definition has no type or storage class 2 | a;b;char c; | ^ main.c:2:3: error: type defaults to 'int' in declaration of 'b' [-Wimplicit-int] main.c:3:5: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token 3 | main{ | ^
s229255203
p03844
C
a;b;char c; main{ scanf("%d%c%d",&a,&c,&b); if(c-'-')printf("%d\n",a+b); else printf("%d\n",a-b); }
main.c:1:1: warning: data definition has no type or storage class 1 | a;b;char c; | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int] main.c:1:3: warning: data definition has no type or storage class 1 | a;b;char c; | ^ main.c:1:3: error: type defaults to 'int' in declaration of 'b' [-Wimplicit-int] main.c:2:5: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token 2 | main{ | ^
s021651351
p03844
C
int main(){a;b;char c;scanf("%d%c%d",&a,&c,&b);if(c-'-')printf("%d\n",a+b);else printf("%d\n",a-b);}
main.c: In function 'main': main.c:1:12: error: 'a' undeclared (first use in this function) 1 | int main(){a;b;char c;scanf("%d%c%d",&a,&c,&b);if(c-'-')printf("%d\n",a+b);else printf("%d\n",a-b);} | ^ main.c:1:12: note: each undeclared identifier is reported only once for each function it appears in main.c:1:14: error: 'b' undeclared (first use in this function) 1 | int main(){a;b;char c;scanf("%d%c%d",&a,&c,&b);if(c-'-')printf("%d\n",a+b);else printf("%d\n",a-b);} | ^ main.c:1:23: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 1 | int main(){a;b;char c;scanf("%d%c%d",&a,&c,&b);if(c-'-')printf("%d\n",a+b);else printf("%d\n",a-b);} | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | int main(){a;b;char c;scanf("%d%c%d",&a,&c,&b);if(c-'-')printf("%d\n",a+b);else printf("%d\n",a-b);} main.c:1:23: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 1 | int main(){a;b;char c;scanf("%d%c%d",&a,&c,&b);if(c-'-')printf("%d\n",a+b);else printf("%d\n",a-b);} | ^~~~~ main.c:1:23: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:1:57: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 1 | int main(){a;b;char c;scanf("%d%c%d",&a,&c,&b);if(c-'-')printf("%d\n",a+b);else printf("%d\n",a-b);} | ^~~~~~ main.c:1:57: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:57: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:1:57: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:81: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] 1 | int main(){a;b;char c;scanf("%d%c%d",&a,&c,&b);if(c-'-')printf("%d\n",a+b);else printf("%d\n",a-b);} | ^~~~~~ main.c:1:81: note: include '<stdio.h>' or provide a declaration of 'printf'
s269838107
p03844
C
main(){a;b;char c;scanf("%d%c%d",&a,&c,&b);if(c-'-')printf("%d\n",a+b);else printf("%d\n",a-b);}
main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int] 1 | main(){a;b;char c;scanf("%d%c%d",&a,&c,&b);if(c-'-')printf("%d\n",a+b);else printf("%d\n",a-b);} | ^~~~ main.c: In function 'main': main.c:1:8: error: 'a' undeclared (first use in this function) 1 | main(){a;b;char c;scanf("%d%c%d",&a,&c,&b);if(c-'-')printf("%d\n",a+b);else printf("%d\n",a-b);} | ^ main.c:1:8: note: each undeclared identifier is reported only once for each function it appears in main.c:1:10: error: 'b' undeclared (first use in this function) 1 | main(){a;b;char c;scanf("%d%c%d",&a,&c,&b);if(c-'-')printf("%d\n",a+b);else printf("%d\n",a-b);} | ^ main.c:1:19: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 1 | main(){a;b;char c;scanf("%d%c%d",&a,&c,&b);if(c-'-')printf("%d\n",a+b);else printf("%d\n",a-b);} | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | main(){a;b;char c;scanf("%d%c%d",&a,&c,&b);if(c-'-')printf("%d\n",a+b);else printf("%d\n",a-b);} main.c:1:19: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 1 | main(){a;b;char c;scanf("%d%c%d",&a,&c,&b);if(c-'-')printf("%d\n",a+b);else printf("%d\n",a-b);} | ^~~~~ main.c:1:19: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:1:53: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 1 | main(){a;b;char c;scanf("%d%c%d",&a,&c,&b);if(c-'-')printf("%d\n",a+b);else printf("%d\n",a-b);} | ^~~~~~ main.c:1:53: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:53: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:1:53: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:77: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] 1 | main(){a;b;char c;scanf("%d%c%d",&a,&c,&b);if(c-'-')printf("%d\n",a+b);else printf("%d\n",a-b);} | ^~~~~~ main.c:1:77: note: include '<stdio.h>' or provide a declaration of 'printf'
s375203983
p03844
C
main{ a;b;char c;scanf("%d%c%d",&a,&c,&b);if(c-'-')printf("%d\n",a+b);else printf("%d\n",a-b);}
main.c:1:5: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token 1 | main{ | ^
s293791804
p03844
C
main{a;b;char c;scanf("%d%c%d",&a,&c,&b);if(c-'-')printf("%d\n",a+b);else printf("%d\n",a-b);}
main.c:1:5: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token 1 | main{a;b;char c;scanf("%d%c%d",&a,&c,&b);if(c-'-')printf("%d\n",a+b);else printf("%d\n",a-b);} | ^
s232611699
p03844
C
a;b;char c; main{scanf("%d%c%d",&a,&c,&b);if(c-'-')printf("%d\n",a+b);else printf("%d\n",a-b);}
main.c:1:1: warning: data definition has no type or storage class 1 | a;b;char c; | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int] main.c:1:3: warning: data definition has no type or storage class 1 | a;b;char c; | ^ main.c:1:3: error: type defaults to 'int' in declaration of 'b' [-Wimplicit-int] main.c:2:5: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token 2 | main{scanf("%d%c%d",&a,&c,&b);if(c-'-')printf("%d\n",a+b);else printf("%d\n",a-b);} | ^
s320610902
p03844
Java
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int A = sc.nextInt(); String op = sc.next(); int B = sc.nextInt(); if(op == "+")System.out.println(A+B); else System.out.pritnln(A-B); } }
Main.java:9: error: cannot find symbol else System.out.pritnln(A-B); ^ symbol: method pritnln(int) location: variable out of type PrintStream 1 error
s169623474
p03844
C
#include <stdio.h> #include <stdlib.h> #include <string.h> int main(int argc, char **argv) { char a[100]; char p[10]; int b,c,d; strcpy(p,"+") scanf("%d %s %d",&b,a,&c); d = strcmp(p,a); if(d==0){ printf("%d\n", b+c); } else{ printf("%d\n", b-c); } return 0; }
main.c: In function 'main': main.c:10:22: error: expected ';' before 'scanf' 10 | strcpy(p,"+") | ^ | ; 11 | scanf("%d %s %d",&b,a,&c); | ~~~~~
s816636921
p03844
C++
#include<cstdio> int main() { int a,c; char b,n,m; int sum; while(scanf("%d",&a)!=EOF) { scanf("%c",&m); scanf("%c",&b); scanf("%c",&n); scanf("%d",&c); if(b==43) { sum=a+c; printf("%d\n",sum); } else { sum=a-c; printf("%d\n",sum); } } return 0;
a.cc: In function 'int main()': a.cc:25:19: error: expected '}' at end of input 25 | return 0; | ^ a.cc:3:1: note: to match this '{' 3 | { | ^
s348862509
p03844
C
#include<cstdio> #include<cstring> #include<cmath> #include<algorithm> using namespace std; int main() { int a,b; char str; scanf("%d%c%d",&a,&str,&b); if(str=='-') printf("%d",a-b); else printf("%d",a+b); return 0; }
main.c:1:9: fatal error: cstdio: No such file or directory 1 | #include<cstdio> | ^~~~~~~~ compilation terminated.
s980598364
p03844
Java
import java.util.Scanner; public class abc_A50 { public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc = new Scanner(System.in); int a=sc.nextInt(); String s = sc.next(); int b=sc.nextInt(); if(s.equals("+")){ System.out.println(a+b); }else if(s.equals("-")){ System.out.println(a-b); } } }
Main.java:3: error: class abc_A50 is public, should be declared in a file named abc_A50.java public class abc_A50 { ^ 1 error
s738311074
p03844
C++
#include<iostresm> using namespace std; int main(){ long long int A,B; char op; cin>>A>>op>>B; if(op=='+') cout<<A+B<<endl; if(op=='-') cout<<A-B<<endl; return 0; }
a.cc:1:9: fatal error: iostresm: No such file or directory 1 | #include<iostresm> | ^~~~~~~~~~ compilation terminated.
s477063354
p03844
C
#include"stdio.h" int main(){ int N; scanf("%d",&N); int po[N]; for(int i=0;i<N;i++){po[i]=(N-i)%2; po[i]*=2; if(po[0]==2)po[0]=1;} for(int i=0;i<N;i++){ int kari; scanf("%d",&kari); po[kari]--;} for(int i=0;i<N;i++)if(po[i]!=0){printf("0\n");return 0;} int ans=1; for(int i=0;i<N/2;i++)ans(ans*2)%1000000007; printf("%d\n",ans); return 0;}
main.c: In function 'main': main.c:15:23: error: called object 'ans' is not a function or function pointer 15 | for(int i=0;i<N/2;i++)ans(ans*2)%1000000007; | ^~~ main.c:14:5: note: declared here 14 | int ans=1; | ^~~
s240830523
p03844
C
#include"stdio.h"  int main(){int N;scanf("%d",&N);int po[N];for(int i=0;i<N;i++)po[i]=2*((N-i)%2);for(int i=0;i<N;i++){int kari;scanf("%d",&kari);po[kari]--;}for(int i=0;i<N;i++)if(po[i]!=0){printf("0\n");return 0;}int ans=1;for(int i=0;i<N/2;i++)ans=(ans*2)%1000000007;printf("%d\n",ans);return 0;}
main.c:2:1: error: stray '\302' in program 2 | <U+00A0>int main(){int N;scanf("%d",&N);int po[N];for(int i=0;i<N;i++)po[i]=2*((N-i)%2);for(int i=0;i<N;i++){int kari;scanf("%d",&kari);po[kari]--;}for(int i=0;i<N;i++)if(po[i]!=0){printf("0\n");return 0;}int ans=1;for(int i=0;i<N/2;i++)ans=(ans*2)%1000000007;printf("%d\n",ans);return 0;} | ^~~~~~~~
s637258990
p03844
C
#include"stdio.h" int main(){int a,b;char nari;scanf("%d %c %d",&a,&nari,&b);if(nari=='+')printf("%d\n",a+b);else printf("%d\n",a-b);return 0;}
main.c:1:18: warning: extra tokens at end of #include directive 1 | #include"stdio.h" int main(){int a,b;char nari;scanf("%d %c %d",&a,&nari,&b);if(nari=='+')printf("%d\n",a+b);else printf("%d\n",a-b);return 0;} | ^ /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s640399948
p03844
C
#include"stdio.h" int main(){int a,b;char nari;scanf("%d %c %d",&a,&nari,&b);if(nari=='+')printf("%d\n",a+b);else printf("%d\n",a-b);return 0;}
main.c:1:18: warning: extra tokens at end of #include directive 1 | #include"stdio.h" int main(){int a,b;char nari;scanf("%d %c %d",&a,&nari,&b);if(nari=='+')printf("%d\n",a+b);else printf("%d\n",a-b);return 0;} | ^ /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s676000960
p03844
C
#include"stdio.h" int main() { int a,b; char nari; scanf("%d %c %d",&a,&nari,&b); if(c=='+')printf("%d\n",a+b); else printf("%d\n",a-b); return 0; }
main.c: In function 'main': main.c:8:4: error: 'c' undeclared (first use in this function) 8 | if(c=='+')printf("%d\n",a+b); | ^ main.c:8:4: note: each undeclared identifier is reported only once for each function it appears in
s162312450
p03844
C
#include <iostream> #include <climits> #include <string> #include <string.h> #include <stdlib.h> #include <algorithm> using namespace std; long long int i,j,ans=1; int ascSort(const void* v1, const void* v2) { const int _v1 = *((const int*)v1); const int _v2 = *((const int*)v2); if ( _v1 < _v2 ) { return 1; } else if ( _v1 > _v2 ) { return -1; } else { return 0; } } int INF = 1<<29; const int mod = 1000000007; int main(){ long int a,b; char s[2]; cin>>a>>s>>b; if(s[0]=='+'){ cout << a+b<<endl; }else{ cout << a-b<<endl; } return 0; }
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s763427838
p03844
C++
#include<bits/stdc++.h> using namespace std; int main() { int a,b; string s; cin >> a >> s >> b; if(s=='+') cout << a+b << endl; else{ cout << a-b << endl; } }
a.cc: In function 'int main()': a.cc:8:13: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char') 8 | if(s=='+') | ~^~~~~ | | | | | char | std::string {aka std::__cxx11::basic_string<char>} In file included from /usr/include/c++/14/regex:68, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181, from a.cc:1: /usr/include/c++/14/bits/regex.h:1103:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const sub_match<_BiIter>&)' 1103 | operator==(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1103:5: note: template argument deduction/substitution failed: a.cc:8:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 8 | if(s=='+') | ^~~ /usr/include/c++/14/bits/regex.h:1199:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator==(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)' 1199 | operator==(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1199:5: note: template argument deduction/substitution failed: a.cc:8:15: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char' 8 | if(s=='+') | ^~~ /usr/include/c++/14/bits/regex.h:1274:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator==(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)' 1274 | operator==(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1274:5: note: template argument deduction/substitution failed: a.cc:8:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 8 | if(s=='+') | ^~~ /usr/include/c++/14/bits/regex.h:1366:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)' 1366 | operator==(typename iterator_traits<_Bi_iter>::value_type const* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1366:5: note: template argument deduction/substitution failed: a.cc:8:15: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char' 8 | if(s=='+') | ^~~ /usr/include/c++/14/bits/regex.h:1441:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)' 1441 | operator==(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1441:5: note: template argument deduction/substitution failed: a.cc:8:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 8 | if(s=='+') | ^~~ /usr/include/c++/14/bits/regex.h:1534:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)' 1534 | operator==(typename iterator_traits<_Bi_iter>::value_type const& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1534:5: note: template argument deduction/substitution failed: a.cc:8:15: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char' 8 | if(s=='+') | ^~~ /usr/include/c++/14/bits/regex.h:1613:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)' 1613 | operator==(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1613:5: note: template argument deduction/substitution failed: a.cc:8:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 8 | if(s=='+') | ^~~ /usr/include/c++/14/bits/regex.h:2186:5: note: candidate: 'template<class _Bi_iter, class _Alloc> bool std::__cxx11::operator==(const match_results<_BiIter, _Alloc>&, const match_results<_BiIter, _Alloc>&)' 2186 | operator==(const match_results<_Bi_iter, _Alloc>& __m1, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:2186:5: note: template argument deduction/substitution failed: a.cc:8:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::match_results<_BiIter, _Alloc>' 8 | if(s=='+') | ^~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51: /usr/include/c++/14/bits/stl_pair.h:1033:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator==(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1033 | operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1033:5: note: template argument deduction/substitution failed: a.cc:8:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>' 8 | if(s=='+') | ^~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:67: /usr/include/c++/14/bits/stl_iterator.h:441:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 441 | operator==(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:441:5: note: template argument deduction/substitution failed: a.cc:8:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 8 | if(s=='+') | ^~~ /usr/include/c++/14/bits/stl_iterator.h:486:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 486 | operator==(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:486:5: note: template argument deduction/substitution failed: a.cc:8:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 8 | if(s=='+') | ^~~ /usr/include/c++/14/bits/stl_iterator.h:1667:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1667 | operator==(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1667:5: note: template argument deduction/substitution failed: a.cc:8:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 8 | if(s=='+') | ^~~ /usr/include/c++/14/bits/stl_iterator.h:1737:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1737 | operator==(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1737:5: note: template argument deduction/substitution failed: a.cc:8:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 8 | if(s=='+') | ^~~ In file included from /usr/include/c++/14/bits/char_traits.h:42, from /usr/include/c++/14/string:42, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/bits/postypes.h:192:5: note: candidate: 'template<class _StateT> bool std::operator==(const fpos<_StateT>&, const fpos<_StateT>&)' 192 | operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/postypes.h:192:5: note: template argument deduction/substitution failed: a.cc:8:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::fpos<_StateT>' 8 | if(s=='+') | ^~~ In file included from /usr/include/c++/14/string:43: /usr/include/c++/14/bits/allocator.h:235:5: note: candidate: 'template<class _T1, class _T2> bool std::operator==(const allocator<_CharT>&, const allocator<_T2>&)' 235 | operator==(const allocator<_T1>&, const allocator<_T2>&) | ^~~~~~~~ /usr/include/c++/14/bits/allocator.h:235:5: note: template argument deduction/substitution failed: a.cc:8:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::allocator<_CharT>' 8 | if(s=='+') | ^~~ 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:629: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> >)' 629 | operator==(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:629:5: note: template argument deduction/substitution failed: a.cc:8:15: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 8 | if(s=='+') | ^~~ /usr/include/c++/14/string_view:6
s101437071
p03844
Java
import java.util.Scanner; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); String s = sc.next(); int m = sc.nextInt(); if(s.equals("+")){ System.out.println(n + m); }else{ Syetem.out.println(n - m); } } }
Main.java:11: error: package Syetem does not exist Syetem.out.println(n - m); ^ 1 error
s000672562
p03844
C++
#include<iostream> #include<algorithm> #include<string> using namespace std; int main(){ int a,c; string b; cin >> a >> b >> c; if(b=="+"){ cout << a+c << endl; }else if(b=="-"){a cout << a-c << endl; } return 0; }
a.cc: In function 'int main()': a.cc:12:27: error: expected ';' before 'cout' 12 | }else if(b=="-"){a | ^ | ; 13 | cout << a-c << endl; | ~~~~
s942701373
p03844
C++
#include <iostream> int main(){ int a,b;char c; std::cin >>a>>c>>b; std::cout<<(c=='+'?a+b:a-b<<std::endl; return 0; }
a.cc: In function 'int main()': a.cc:5:27: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<' 5 | std::cout<<(c=='+'?a+b:a-b<<std::endl; | ~~~^~~~~~~~~~~ a.cc:5:38: error: expected ')' before ';' token 5 | std::cout<<(c=='+'?a+b:a-b<<std::endl; | ~ ^ | )
s176353421
p03844
C++
#include <iostream> int main(){ int a,b;char c; std::cin >>a>>c>>b; std::cout<<(c=='+'?a+b:a-b)<<std::endl; resurn 0; }
a.cc: In function 'int main()': a.cc:6:1: error: 'resurn' was not declared in this scope 6 | resurn 0; | ^~~~~~
s071453783
p03844
C++
#include <iostream> int main(){ int a,b;char c; std::cin >>a>>c>>b; std::cout<<(c=='+'?a+b:a-b<<std::endl; resurn 0; }
a.cc: In function 'int main()': a.cc:5:27: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<' 5 | std::cout<<(c=='+'?a+b:a-b<<std::endl; | ~~~^~~~~~~~~~~ a.cc:5:38: error: expected ')' before ';' token 5 | std::cout<<(c=='+'?a+b:a-b<<std::endl; | ~ ^ | ) a.cc:6:1: error: 'resurn' was not declared in this scope 6 | resurn 0; | ^~~~~~
s792732867
p03844
C++
main(){int a,b;char o;scanf("%d%s%d",a,o,b);printf("%d",o=='+'?a+b:a-b);}
a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 1 | main(){int a,b;char o;scanf("%d%s%d",a,o,b);printf("%d",o=='+'?a+b:a-b);} | ^~~~ a.cc: In function 'int main()': a.cc:1:23: error: 'scanf' was not declared in this scope 1 | main(){int a,b;char o;scanf("%d%s%d",a,o,b);printf("%d",o=='+'?a+b:a-b);} | ^~~~~ a.cc:1:45: error: 'printf' was not declared in this scope 1 | main(){int a,b;char o;scanf("%d%s%d",a,o,b);printf("%d",o=='+'?a+b:a-b);} | ^~~~~~ a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' +++ |+#include <cstdio> 1 | main(){int a,b;char o;scanf("%d%s%d",a,o,b);printf("%d",o=='+'?a+b:a-b);}
s309688710
p03844
C++
#include<bits/stdc++.h> #define rep(i,a,b) for(int i=a;i<b;i++) #define rrep(i,a,b) for(int i=a;i>=b;i--) #define fore(i,a) for(auto &i:a) #pragma GCC optimize ("-O3") using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); } #include <boost/multiprecision/cpp_int.hpp> using namespace boost::multiprecision; using number = cpp_int; //using number = int; //--------------------------------------------------------------------------------------------------- /*---------------------------------------------------------------------------------------------------             ∧_∧       ∧_∧  (´<_` )  Welcome to My Coding Space!      ( ´_ゝ`) /  ⌒i     /   \    | |     /   / ̄ ̄ ̄ ̄/  |   __(__ニつ/  _/ .| .|____      \/____/ (u ⊃ ---------------------------------------------------------------------------------------------------*/ number A, B; string op; //--------------------------------------------------------------------------------------------------- void _main() { cin >> A >> op >> B; number ans; if (op == "+") ans = A + B; else ans = A - B; cout << ans << endl; }
a.cc:7:10: fatal error: boost/multiprecision/cpp_int.hpp: No such file or directory 7 | #include <boost/multiprecision/cpp_int.hpp> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated.
s730775979
p03844
C++
#include<bits/stdc++.h> #define rep(i,a,b) for(int i=a;i<b;i++) #define rrep(i,a,b) for(int i=a;i>=b;i--) #define fore(i,a) for(auto &i:a) #pragma GCC optimize ("-O3") using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); } #include <boost/multiprecision/cpp_int.hpp> using namespace boost::multiprecision; using number = cpp_int; //using number = int; //--------------------------------------------------------------------------------------------------- /*---------------------------------------------------------------------------------------------------             ∧_∧       ∧_∧  (´<_` )  Welcome to My Coding Space!      ( ´_ゝ`) /  ⌒i     /   \    | |     /   / ̄ ̄ ̄ ̄/  |   __(__ニつ/  _/ .| .|____      \/____/ (u ⊃ ---------------------------------------------------------------------------------------------------*/ number A, B; string op; //--------------------------------------------------------------------------------------------------- void _main() { int a, b; cin >> a >> op >> b; A = a; B = b; number ans; if (op == "+") ans = A + B; else ans = A - B; cout << ans << endl; }
a.cc:7:10: fatal error: boost/multiprecision/cpp_int.hpp: No such file or directory 7 | #include <boost/multiprecision/cpp_int.hpp> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated.
s868858530
p03844
C++
#include<iostream> #include<string> using namespace std; int main() { int a ,b; string op; cin>a>>op>>b; if(op=="+") { cout<<a+b<<endl; } if(op=="-") { cout<<a-b<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:8:8: error: no match for 'operator>>' (operand types are 'int' and 'std::string' {aka 'std::__cxx11::basic_string<char>'}) 8 | cin>a>>op>>b; | ~^~~~ | | | | | std::string {aka std::__cxx11::basic_string<char>} | int In file included from /usr/include/c++/14/string:55, 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.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:8:10: note: mismatched types 'std::basic_istream<_CharT, _Traits>' and 'int' 8 | cin>a>>op>>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:8:7: note: cannot convert 'a' (type 'int') to type 'std::byte' 8 | cin>a>>op>>b; | ^ In file included from /usr/include/c++/14/istream:1109, from /usr/include/c++/14/iostream:42: /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:8:10: note: mismatched types 'std::basic_istream<_CharT, _Traits>' and 'int' 8 | cin>a>>op>>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:8:10: note: mismatched types 'std::basic_istream<char, _Traits>' and 'int' 8 | cin>a>>op>>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:8:10: note: mismatched types 'std::basic_istream<char, _Traits>' and 'int' 8 | cin>a>>op>>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:8:10: note: mismatched types 'std::basic_istream<_CharT, _Traits>' and 'int' 8 | cin>a>>op>>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:8:10: note: mismatched types 'std::basic_istream<char, _Traits>' and 'int' 8 | cin>a>>op>>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:8:10: note: mismatched types 'std::basic_istream<char, _Traits>' and 'int' 8 | cin>a>>op>>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 = int&; _Tp = std::__cxx11::basic_string<char>&]': a.cc:8:10: required from here 8 | cin>a>>op>>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) | ^~~~~~~~
s423672122
p03844
C
#include <stdio.h> int main(void) { int a, b; char op; scanf("%d %c %d", &a, &op, &b); printf("%d\n", op == '+' : a + b : a - b); return 0; }
main.c: In function 'main': main.c:9:33: error: expected ')' before ':' token 9 | printf("%d\n", op == '+' : a + b : a - b); | ~ ^~ | )
s439409264
p03844
C++
print(eval(input()))
a.cc:1:6: error: expected constructor, destructor, or type conversion before '(' token 1 | print(eval(input())) | ^
s782182481
p03844
C++
#include<bits/stdc++.h> using namespace std; int main(){ int a, b; char op; cin >> a >> op >> b; if( op == "+" ){ cout << a+b << endl; }else{ cout << a-b << endl; } return 0; }
a.cc: In function 'int main()': a.cc:7:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 7 | if( op == "+" ){ | ~~~^~~~~~
s215655795
p03844
C++
#include<bits/stdc++.h> using namespace std; int main(){ int a, b; char op; cin >> a >> op >> b; if( op == + ){ cout << a+b << endl; }else{ cout << a-b << endl; } return 0; }
a.cc: In function 'int main()': a.cc:7:17: error: expected primary-expression before ')' token 7 | if( op == + ){ | ^
s448221393
p03844
C++
#include<bits/stdc++.h> using namespace std; int main(){ int a, b; char op cin >> a >> op >> b; if( op == + ){ cout << a+b << endl; }else{ cout << a-b << endl; } return 0; }
a.cc: In function 'int main()': a.cc:6:5: error: expected initializer before 'cin' 6 | cin >> a >> op >> b; | ^~~ a.cc:7:9: error: 'op' was not declared in this scope 7 | if( op == + ){ | ^~ a.cc:7:17: error: expected primary-expression before ')' token 7 | if( op == + ){ | ^
s809608245
p03844
C++
#include<bits/stdc++.h> using namespace std; int main(){ int a, op, b; cin >> a >> op >> b; if( op == + ){ cout << a+b << endl; }else{ cout << a-b << endl; } return 0; }
a.cc: In function 'int main()': a.cc:6:13: error: expected primary-expression before ')' token 6 | if( op == + ){ | ^
s931103581
p03844
C++
#include <iostream> using namespace std; int main(){ int a,b; char c; cin >> a >> c >> b; if(c == "+")cout << a+b << endl; else if(c == "-")cout << a-b << endl; return 0; }
a.cc: In function 'int main()': a.cc:10:14: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 10 | if(c == "+")cout << a+b << endl; | ~~^~~~~~ a.cc:11:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 11 | else if(c == "-")cout << a-b << endl; | ~~^~~~~~
s321574543
p03844
C++
#include<bits/stdc++.h> using namespace std; int main(){ int a, op, b; cin >> a >> op >> b; if( op == "+" ){ cout << a+b << endl; }else{ cout << a-b << endl; } return 0; }
a.cc: In function 'int main()': a.cc:6:8: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 6 | if( op == "+" ){ | ~~~^~~~~~
s888896412
p03844
C++
#include <bits/stdc++.h> using namespace std; int main(){ int a,b; char c; cin >> a >> c >> b; if(c == +)cout << a+b << endl; else if(c == -)cout << a-b << endl; return 0; }
a.cc: In function 'int main()': a.cc:10:18: error: expected primary-expression before ')' token 10 | if(c == +)cout << a+b << endl; | ^ a.cc:11:23: error: expected primary-expression before ')' token 11 | else if(c == -)cout << a-b << endl; | ^
s112963840
p03844
C++
#include <iosteam> using namespace std; int main(){ int a,b; char op; cin >> a >> op >> b; if(op=='+'){ cout << a+b << endl; }else{ cout << a-b << endl; } return 0; }
a.cc:1:10: fatal error: iosteam: No such file or directory 1 | #include <iosteam> | ^~~~~~~~~ compilation terminated.
s183094026
p03844
C++
#define rep(i,n) FOR(i,0,n) #define pb push_back #define mp make_pair #define all(a) a.begin(),a.end() #define rall(a) a.rbegin(),a.rend() #define rmsame(a) sort(all(a)),a.erase(unique(all(a)), a.end()) #define rmvector(a,b) rep(i,a.size())rep(j,b.size())if(a[i]==b[j]){a.erase(a.begin()+i);i--;break;} int main(){ cin.tie(0); ios::sync_with_stdio(false); ll A,B; char op; cin >> A >> op >> B; if(op=='+') cout << A+B << endl; else cout << A-B << endl; return 0; }
a.cc: In function 'int main()': a.cc:10:3: error: 'cin' was not declared in this scope 10 | cin.tie(0); | ^~~ a.cc:11:3: error: 'ios' has not been declared 11 | ios::sync_with_stdio(false); | ^~~ a.cc:13:3: error: 'll' was not declared in this scope; did you mean 'all'? 13 | ll A,B; | ^~ | all a.cc:15:10: error: 'A' was not declared in this scope 15 | cin >> A >> op >> B; | ^ a.cc:15:21: error: 'B' was not declared in this scope 15 | cin >> A >> op >> B; | ^ a.cc:16:15: error: 'cout' was not declared in this scope 16 | if(op=='+') cout << A+B << endl; | ^~~~ a.cc:16:30: error: 'endl' was not declared in this scope 16 | if(op=='+') cout << A+B << endl; | ^~~~ a.cc:17:8: error: 'cout' was not declared in this scope 17 | else cout << A-B << endl; | ^~~~ a.cc:17:23: error: 'endl' was not declared in this scope 17 | else cout << A-B << endl; | ^~~~
s481210087
p03844
C++
#define _CRT_SECURE_NO_WARNINGS #include<iostream> #include<cstdio> #include<cstdlib> #include<string> #include<algorithm> #include<cmath> #include<queue> #include<vector> #include<stack> using namespace std; #define REP(i,n) for(int i=0;(i)<(n);(i)++) #define ll long long int main() { int a,b; string s; cin >> a >> s >> b; cout << (s=='+'?a+b:a-b) << endl; return 0; }
a.cc: In function 'int main()': a.cc:22:19: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char') 22 | cout << (s=='+'?a+b:a-b) << endl; | ~^~~~~ | | | | | char | std::string {aka std::__cxx11::basic_string<char>} 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:2: /usr/include/c++/14/bits/postypes.h:192:5: note: candidate: 'template<class _StateT> bool std::operator==(const fpos<_StateT>&, const fpos<_StateT>&)' 192 | operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/postypes.h:192:5: note: template argument deduction/substitution failed: a.cc:22:21: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::fpos<_StateT>' 22 | cout << (s=='+'?a+b:a-b) << endl; | ^~~ 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:235:5: note: candidate: 'template<class _T1, class _T2> bool std::operator==(const allocator<_CharT>&, const allocator<_T2>&)' 235 | operator==(const allocator<_T1>&, const allocator<_T2>&) | ^~~~~~~~ /usr/include/c++/14/bits/allocator.h:235:5: note: template argument deduction/substitution failed: a.cc:22:21: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::allocator<_CharT>' 22 | cout << (s=='+'?a+b:a-b) << endl; | ^~~ In file included from /usr/include/c++/14/string:48: /usr/include/c++/14/bits/stl_iterator.h:441:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 441 | operator==(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:441:5: note: template argument deduction/substitution failed: a.cc:22:21: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 22 | cout << (s=='+'?a+b:a-b) << endl; | ^~~ /usr/include/c++/14/bits/stl_iterator.h:486:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 486 | operator==(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:486:5: note: template argument deduction/substitution failed: a.cc:22:21: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 22 | cout << (s=='+'?a+b:a-b) << endl; | ^~~ /usr/include/c++/14/bits/stl_iterator.h:1667:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1667 | operator==(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1667:5: note: template argument deduction/substitution failed: a.cc:22:21: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 22 | cout << (s=='+'?a+b:a-b) << endl; | ^~~ /usr/include/c++/14/bits/stl_iterator.h:1737:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1737 | operator==(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1737:5: note: template argument deduction/substitution failed: a.cc:22:21: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 22 | cout << (s=='+'?a+b:a-b) << endl; | ^~~ 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:1033:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator==(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1033 | operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1033:5: note: template argument deduction/substitution failed: a.cc:22:21: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>' 22 | cout << (s=='+'?a+b:a-b) << endl; | ^~~ 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:629: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> >)' 629 | operator==(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:629:5: note: template argument deduction/substitution failed: a.cc:22:21: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 22 | cout << (s=='+'?a+b:a-b) << endl; | ^~~ /usr/include/c++/14/string_view:637:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator==(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 637 | operator==(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:637:5: note: template argument deduction/substitution failed: a.cc:22:21: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 22 | cout << (s=='+'?a+b:a-b) << endl; | ^~~ /usr/include/c++/14/string_view:644: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>)' 644 | operator==(__type_identity_t<basic_string_view<_CharT, _Traits>> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:644:5: note: template argument deduction/substitution failed: a.cc:22:21: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'char' 22 | cout << (s=='+'?a+b:a-b) << endl; | ^~~ /usr/include/c++/14/bits/basic_string.h:3755: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>&)' 3755 | operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3755:5: note: template argument deduction/substitution failed: a.cc:22:21: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'char' 22 | cout << (s=='+'?a+b:a-b) << endl; | ^~~ /usr/include/c++/14/bits/basic_string.h:3772:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 3772 | operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3772:5: note: template argument deduction/substitution failed: a.cc:22:21: note: mismatched types 'const _CharT*' and 'char' 22 | cout << (s=='+'?a+b:a-b) << endl; | ^~~ /usr/include/c++/14/bits/basic_string.h:3819:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3819 | operator==(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3819:5: note: template argument deduction/substitution failed: a.cc:22:21: note: mismatched types 'const _CharT*' and 'std::__cxx11::basic_string<char>' 22 | cout << (s=='+'?a+b:a-b) << endl; | ^~~ 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:2558:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator==(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)' 2558 | operator==(const tuple<_TElements...>& __t, | ^~~~~~~~ /usr/include/c++/14/tuple:2558:5: note: template argument deduction/substitution failed: a.cc:22:21: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::tuple<_UTypes ...>' 22 | cout << (s=='+'?a+b:a-b) << endl; | ^~~ In file included from /usr/include/c++/14/bits/locale_facets.h:48, from /usr/include/c++/14/bits/basic_ios.h:37, from /usr/include/c++/14/ios:46: /usr/include/c++/14/bits/streambuf_iterator.h:234:5: note: candidate: 'template<class _CharT, class _Traits> bool std::operator==(const istreambuf_iterator<_CharT, _Traits>&, const istreambuf_iterator<_CharT, _Traits>&)' 234 | operator==(const istreambuf_iterator<_CharT, _Traits>& __a, | ^~~~~~~~ /usr/include/c++/14/bits/streambuf_iterator.h:234:5: note: template argument deduction/substitution failed: a.cc:22:21: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::istreambuf_iterator<_CharT
s533097958
p03844
C++
#include<bits/stdc++.h> using namespace std; char s[100]; int ac,a,b,c,d; int main(){ gets(s); int len=strlen(s); d=0; a=b=0; for (int i=0; i<len; i++){ if (s[i]>='0'&&s[i]<='9'){ if (!d) a=a*10+s[i]-48; else b=b*10+s[i]-48; } else if (s[i]=='+') c=1,d=1; else if (s[i]=='-') c=-1,d=1; } printf("%d\n",a+c*b); return 0; }
a.cc: In function 'int main()': a.cc:6:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 6 | gets(s); | ^~~~ | getw
s905197516
p03844
C++
#include<bits/stdc++.h> using namespace std; char s[100]; int ac,a,b,c,d; int main(){ gets(s); int len=strlen(s); d=0; a=b=0; for (int i=0; i<len; i++){ if (s[i]>='0'&&s[i]<='9'){ if (!d) a=a*10+s[i]-48; else b=b*10+s[i]-48; } else if (s[i]=='+') c=1,d=1; else if (s[i]=='-') c=-1,d=1; } printf("%d\n",a+c*b); return 0; }
a.cc: In function 'int main()': a.cc:6:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 6 | gets(s); | ^~~~ | getw
s715862986
p03844
C++
#include<cstdio> #include<cstring> #include<cstdlib> #include<string> using namespace std; char s[100]; int ac,a,b,c,d; int main(){ gets(s); int len=strlen(s); d=0; a=b=0; for (int i=0; i<len; i++){ if (s[i]>='0'&&s[i]<='9'){ if (!d) a=a*10+s[i]-48; else b=b*10+s[i]-48; } else if (s[i]=='+') c=1,d=1; else if (s[i]=='-') c=-1,d=1; } printf("%d\n",a+c*b); return 0; }
a.cc: In function 'int main()': a.cc:9:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 9 | gets(s); | ^~~~ | getw
s494503145
p03844
C++
#include<cstdio> #include<cstring> char s[100],len,i; int ac,a,b,c,d; int main(){ gets(s); len=strlen(s); d=0; a=b=0; for (i=0; i<len; i++){ if (s[i]>='0'&&s[i]<='9'){ if (!d) a=a*10+s[i]-48; else b=b*10+s[i]-48; } else if (s[i]=='+') c=1,d=1; else if (s[i]=='-') c=-1,d=1; } printf("%d\n",a+c*b); return 0; }
a.cc: In function 'int main()': a.cc:6:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 6 | gets(s); | ^~~~ | getw
s537715939
p03844
C++
$0=($2=="+"?$1+$3:$1-$3)""
a.cc:1:1: error: '$0' does not name a type 1 | $0=($2=="+"?$1+$3:$1-$3)"" | ^~
s891841919
p03844
C++
int main(){ int A, B; string op; cin >> A >>op>> B; if (op == "+"){ cout << A + B<< endl; } else{ cout << A - B << endl; } return 0; }
a.cc: In function 'int main()': a.cc:3:9: error: 'string' was not declared in this scope 3 | string op; | ^~~~~~ a.cc:4:9: error: 'cin' was not declared in this scope 4 | cin >> A >>op>> B; | ^~~ a.cc:4:20: error: 'op' was not declared in this scope 4 | cin >> A >>op>> B; | ^~ a.cc:6:17: error: 'cout' was not declared in this scope 6 | cout << A + B<< endl; | ^~~~ a.cc:6:33: error: 'endl' was not declared in this scope 6 | cout << A + B<< endl; | ^~~~ a.cc:9:17: error: 'cout' was not declared in this scope 9 | cout << A - B << endl; | ^~~~ a.cc:9:34: error: 'endl' was not declared in this scope 9 | cout << A - B << endl; | ^~~~
s636508707
p03844
C++
#include <iostream> using namespace std; int main() { // your code goes here long long int a,b; char x; cin>>a; cin>>x; cin>>b; if(x == '+') cout<<a+b<<:"\n"; else cout<<a-b<<"\n"; return 0; }
a.cc: In function 'int main()': a.cc:14:24: error: expected primary-expression before ':' token 14 | cout<<a+b<<:"\n"; | ^
s108207028
p03844
C++
#include<iostream> using namespace std; int main(){ int a,b; string op; cin>>a>>op>>b; if(op=='+'){ cout<<a+b<<endl; }else{ cout<<a-b<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:9:14: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char') 9 | if(op=='+'){ | ~~^~~~~ | | | | | char | std::string {aka std::__cxx11::basic_string<char>} 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:1: /usr/include/c++/14/bits/postypes.h:192:5: note: candidate: 'template<class _StateT> bool std::operator==(const fpos<_StateT>&, const fpos<_StateT>&)' 192 | operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/postypes.h:192:5: note: template argument deduction/substitution failed: a.cc:9:16: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::fpos<_StateT>' 9 | if(op=='+'){ | ^~~ 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:235:5: note: candidate: 'template<class _T1, class _T2> bool std::operator==(const allocator<_CharT>&, const allocator<_T2>&)' 235 | operator==(const allocator<_T1>&, const allocator<_T2>&) | ^~~~~~~~ /usr/include/c++/14/bits/allocator.h:235:5: note: template argument deduction/substitution failed: a.cc:9:16: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::allocator<_CharT>' 9 | if(op=='+'){ | ^~~ In file included from /usr/include/c++/14/string:48: /usr/include/c++/14/bits/stl_iterator.h:441:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 441 | operator==(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:441:5: note: template argument deduction/substitution failed: a.cc:9:16: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 9 | if(op=='+'){ | ^~~ /usr/include/c++/14/bits/stl_iterator.h:486:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 486 | operator==(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:486:5: note: template argument deduction/substitution failed: a.cc:9:16: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 9 | if(op=='+'){ | ^~~ /usr/include/c++/14/bits/stl_iterator.h:1667:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1667 | operator==(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1667:5: note: template argument deduction/substitution failed: a.cc:9:16: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 9 | if(op=='+'){ | ^~~ /usr/include/c++/14/bits/stl_iterator.h:1737:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1737 | operator==(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1737:5: note: template argument deduction/substitution failed: a.cc:9:16: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 9 | if(op=='+'){ | ^~~ 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:1033:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator==(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1033 | operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1033:5: note: template argument deduction/substitution failed: a.cc:9:16: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>' 9 | if(op=='+'){ | ^~~ 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:629: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> >)' 629 | operator==(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:629:5: note: template argument deduction/substitution failed: a.cc:9:16: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 9 | if(op=='+'){ | ^~~ /usr/include/c++/14/string_view:637:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator==(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 637 | operator==(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:637:5: note: template argument deduction/substitution failed: a.cc:9:16: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 9 | if(op=='+'){ | ^~~ /usr/include/c++/14/string_view:644: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>)' 644 | operator==(__type_identity_t<basic_string_view<_CharT, _Traits>> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:644:5: note: template argument deduction/substitution failed: a.cc:9:16: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'char' 9 | if(op=='+'){ | ^~~ /usr/include/c++/14/bits/basic_string.h:3755: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>&)' 3755 | operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3755:5: note: template argument deduction/substitution failed: a.cc:9:16: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'char' 9 | if(op=='+'){ | ^~~ /usr/include/c++/14/bits/basic_string.h:3772:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 3772 | operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3772:5: note: template argument deduction/substitution failed: a.cc:9:16: note: mismatched types 'const _CharT*' and 'char' 9 | if(op=='+'){ | ^~~ /usr/include/c++/14/bits/basic_string.h:3819:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3819 | operator==(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3819:5: note: template argument deduction/substitution failed: a.cc:9:16: note: mismatched types 'const _CharT*' and 'std::__cxx11::basic_string<char>' 9 | if(op=='+'){ | ^~~ 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:2558:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator==(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)' 2558 | operator==(const tuple<_TElements...>& __t, | ^~~~~~~~ /usr/include/c++/14/tuple:2558:5: note: template argument deduction/substitution failed: a.cc:9:16: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::tuple<_UTypes ...>' 9 | if(op=='+'){ | ^~~ In file included from /usr/include/c++/14/bits/locale_facets.h:48, from /usr/include/c++/14/bits/basic_ios.h:37, from /usr/include/c++/14/ios:46: /usr/include/c++/14/bits/streambuf_iterator.h:234:5: note: candidate: 'template<class _CharT, class _Traits> bool std::operator==(const istreambuf_iterator<_CharT, _Traits>&, const istreambuf_iterator<_CharT, _Traits>&)' 234 | operator==(const istreambuf_iterator<_CharT, _Traits>& __a, | ^~~~~~~~ /usr/include/c++/14/bits/streambuf_iterator.h:234:5: note: template argument deduction/substitution failed: a.cc:9:16: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::istreambuf_iterator<_CharT, _Traits>' 9 | if(op=='+'){ | ^~~ In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/c++allocator.h:33, from /usr/include/c++/14/bits/allocator.h:46: /usr/include/c++/14/bits/new_allocator.h:215:9: note: candidate: 'template<class _Up> bool std::operator==(const __new_allocator<char>&, const __new_allocator<_Tp>&)' 215 | operator==(const __new_al
s478415669
p03844
C++
#include<stdio.h> int main(void){ int a,b; char c; scanf("%d %c %d",&a,&c,&b); if(c='+'){pritf("%d",a+b);} else{printf("%d",a-b);} return 0; }
a.cc: In function 'int main()': a.cc:6:11: error: 'pritf' was not declared in this scope; did you mean 'printf'? 6 | if(c='+'){pritf("%d",a+b);} | ^~~~~ | printf
s807916554
p03844
C++
package main import ( "fmt" ) func main(){ var a,b int var o string fmt.Scan(&a, &o, &b) if o == "-" { fmt.Println(a-b) } else if o == "+" { fmt.Println(a+b) } }
a.cc:1:1: error: 'package' does not name a type 1 | package main | ^~~~~~~
s609431439
p03844
C++
#include <iostream> using namespace std; int main(){ int a,b; cin>>a>>b; char t; if(t=="+"){ cout<<a+b; } if(t=="-"){ cout<<a-b; } }
a.cc: In function 'int main()': a.cc:7:5: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 7 | if(t=="+"){ | ~^~~~~ a.cc:10:5: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 10 | if(t=="-"){ | ~^~~~~
s931317632
p03844
Java
import java.util.*; public class AdditionandSubtractionEasy { public static void main(String[] args) { // TODO Auto-generated method stub Scanner s=new Scanner(System.in); int A=s.nextInt(); String op=s.next(); int B=s.nextInt(); if(op.charAt(0)=='+'){ System.out.print(A+B); }else System.out.print(A-B); } }
Main.java:3: error: class AdditionandSubtractionEasy is public, should be declared in a file named AdditionandSubtractionEasy.java public class AdditionandSubtractionEasy { ^ 1 error
s120815889
p03844
Java
import java.util.Scanner; public class joisino { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int A = sc.nextInt(); String op = sc.next(); int B = sc.nextInt(); if(op.equals("+")){ System.out.println("A+B"); }else if(op.equals("-")){ System.out.print(A - B); } } }
Main.java:3: error: class joisino is public, should be declared in a file named joisino.java public class joisino { ^ 1 error
s882461639
p03844
Java
import java.util.Scanner; public class joisino { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int A = sc.nextInt(); String op = sc.next(); int B = sc.nextInt(); if(op.equals("+")){ System.out.println("A+B"); }else if(op.equals("-")){ System.out.print(A - B); } } }
Main.java:3: error: class joisino is public, should be declared in a file named joisino.java public class joisino { ^ 1 error
s541062963
p03844
Java
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int A = sc.nextInt(); char op = sc.next(); int B = sc.nextInt(); if(op.equals("+"))System.out.println(A + B); if(op.equals("-"))System.out.println(A - B); } }
Main.java:6: error: incompatible types: String cannot be converted to char char op = sc.next(); ^ Main.java:8: error: char cannot be dereferenced if(op.equals("+"))System.out.println(A + B); ^ Main.java:9: error: char cannot be dereferenced if(op.equals("-"))System.out.println(A - B); ^ 3 errors
s792210206
p03844
C++
#include <bits/stdc++.h> using namespace std; int main() { int a, b; string op; cin >> a >> op >> b; cout << (op == '+' ? a + b : a - b) << endl; }
a.cc: In function 'int main()': a.cc:8:15: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char') 8 | cout << (op == '+' ? a + b : a - b) << endl; | ~~ ^~ ~~~ | | | | | char | std::string {aka std::__cxx11::basic_string<char>} In file included from /usr/include/c++/14/regex:68, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181, from a.cc:1: /usr/include/c++/14/bits/regex.h:1103:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const sub_match<_BiIter>&)' 1103 | operator==(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1103:5: note: template argument deduction/substitution failed: a.cc:8:18: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 8 | cout << (op == '+' ? a + b : a - b) << endl; | ^~~ /usr/include/c++/14/bits/regex.h:1199:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator==(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)' 1199 | operator==(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1199:5: note: template argument deduction/substitution failed: a.cc:8:18: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char' 8 | cout << (op == '+' ? a + b : a - b) << endl; | ^~~ /usr/include/c++/14/bits/regex.h:1274:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator==(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)' 1274 | operator==(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1274:5: note: template argument deduction/substitution failed: a.cc:8:18: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 8 | cout << (op == '+' ? a + b : a - b) << endl; | ^~~ /usr/include/c++/14/bits/regex.h:1366:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)' 1366 | operator==(typename iterator_traits<_Bi_iter>::value_type const* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1366:5: note: template argument deduction/substitution failed: a.cc:8:18: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char' 8 | cout << (op == '+' ? a + b : a - b) << endl; | ^~~ /usr/include/c++/14/bits/regex.h:1441:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)' 1441 | operator==(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1441:5: note: template argument deduction/substitution failed: a.cc:8:18: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 8 | cout << (op == '+' ? a + b : a - b) << endl; | ^~~ /usr/include/c++/14/bits/regex.h:1534:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)' 1534 | operator==(typename iterator_traits<_Bi_iter>::value_type const& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1534:5: note: template argument deduction/substitution failed: a.cc:8:18: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char' 8 | cout << (op == '+' ? a + b : a - b) << endl; | ^~~ /usr/include/c++/14/bits/regex.h:1613:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)' 1613 | operator==(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1613:5: note: template argument deduction/substitution failed: a.cc:8:18: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 8 | cout << (op == '+' ? a + b : a - b) << endl; | ^~~ /usr/include/c++/14/bits/regex.h:2186:5: note: candidate: 'template<class _Bi_iter, class _Alloc> bool std::__cxx11::operator==(const match_results<_BiIter, _Alloc>&, const match_results<_BiIter, _Alloc>&)' 2186 | operator==(const match_results<_Bi_iter, _Alloc>& __m1, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:2186:5: note: template argument deduction/substitution failed: a.cc:8:18: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::match_results<_BiIter, _Alloc>' 8 | cout << (op == '+' ? a + b : a - b) << endl; | ^~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51: /usr/include/c++/14/bits/stl_pair.h:1033:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator==(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1033 | operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1033:5: note: template argument deduction/substitution failed: a.cc:8:18: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>' 8 | cout << (op == '+' ? a + b : a - b) << endl; | ^~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:67: /usr/include/c++/14/bits/stl_iterator.h:441:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 441 | operator==(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:441:5: note: template argument deduction/substitution failed: a.cc:8:18: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 8 | cout << (op == '+' ? a + b : a - b) << endl; | ^~~ /usr/include/c++/14/bits/stl_iterator.h:486:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 486 | operator==(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:486:5: note: template argument deduction/substitution failed: a.cc:8:18: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 8 | cout << (op == '+' ? a + b : a - b) << endl; | ^~~ /usr/include/c++/14/bits/stl_iterator.h:1667:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1667 | operator==(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1667:5: note: template argument deduction/substitution failed: a.cc:8:18: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 8 | cout << (op == '+' ? a + b : a - b) << endl; | ^~~ /usr/include/c++/14/bits/stl_iterator.h:1737:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1737 | operator==(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1737:5: note: template argument deduction/substitution failed: a.cc:8:18: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 8 | cout << (op == '+' ? a + b : a - b) << endl; | ^~~ In file included from /usr/include/c++/14/bits/char_traits.h:42, from /usr/include/c++/14/string:42, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/bits/postypes.h:192:5: note: candidate: 'template<class _StateT> bool std::operator==(const fpos<_StateT>&, const fpos<_StateT>&)' 192 | operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/postypes.h:192:5: note: template argument deduction/substitution failed: a.cc:8:18: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::fpos<_StateT>' 8 | cout << (op == '+' ? a + b : a - b) << endl; | ^~~ In file included from /usr/include/c++/14/string:43: /usr/include/c++/14/bits/allocator.h:235:5: note: candidate: 'template<class _T1, class _T2> bool std::operator==(const allocator<_CharT>&, const allocator<_T2>&)' 235 | operator==(const allocator<_T1>&, const allocator<_T2>&) | ^~~~~~~~ /usr/include/c++/14/bits/allocator.h:235:5: note: template argument deduction/substitution failed: a.cc:8:18: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::allocator<_CharT>' 8 | cout << (op == '+' ? a + b : a - b) << endl; | ^~~ 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:629:5: note: candidate: 'template<class _CharT, class _Traits> cons
s625365420
p03844
Java
public static void main (String args[]){ int A=3; int B=5; if(op == -){ A op B=answer; System.out.print(answer); } }
Main.java:1: error: unnamed classes are a preview feature and are disabled by default. public static void main (String args[]){ ^ (use --enable-preview to enable unnamed classes) Main.java:4: error: illegal start of expression if(op == -){ ^ Main.java:5: error: ';' expected A op B=answer; ^ 3 errors
s979046374
p03844
C++
(defun main () (setq a (read)) (setq or (read-line)) (setq b (read)) (cond ((= or +) (format t "~A~%" (+ a b))) (= or -) (format " ~A~%" (- a b)))) (main)
a.cc:1:7: error: expected ')' before 'main' 1 | (defun main () | ~ ^~~~~ | )
s729649113
p03844
C++
#include <iostream> #include <cstdio> #include <string> #include <sstream> #include <vector> using namespace std; int stoi(std::string str){ int ret; std::stringstream ss; ss<<str; ss>>ret; return ret; } vector<string> split(const string &s, char delim) { vector<string> elems; stringstream ss(s); string item; while (getline(ss, item, delim)) { if (!item.empty()) { elems.push_back(item); } } return elems; } int main() { string Str; vector<string> ans; int a,b; getline(cin, Str); ans = split(Str,' '); a = stoi(ans[0]); b = stoi(ans[2]); if(ans[1]=="+") printf("%d\n",a+b); else printf("%d\n",a-b); return 0; }
a.cc: In function 'int main()': a.cc:42:11: error: call of overloaded 'stoi(__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type&)' is ambiguous 42 | a = stoi(ans[0]); | ~~~~^~~~~~~~ a.cc:9:5: note: candidate: 'int stoi(std::string)' 9 | int stoi(std::string str){ | ^~~~ 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:4164:3: note: candidate: 'int std::__cxx11::stoi(const std::string&, std::size_t*, int)' 4164 | stoi(const string& __str, size_t* __idx = 0, int __base = 10) | ^~~~ a.cc:43:11: error: call of overloaded 'stoi(__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type&)' is ambiguous 43 | b = stoi(ans[2]); | ~~~~^~~~~~~~ a.cc:9:5: note: candidate: 'int stoi(std::string)' 9 | int stoi(std::string str){ | ^~~~ /usr/include/c++/14/bits/basic_string.h:4164:3: note: candidate: 'int std::__cxx11::stoi(const std::string&, std::size_t*, int)' 4164 | stoi(const string& __str, size_t* __idx = 0, int __base = 10) | ^~~~
s986684906
p03844
C++
#include <iostream> #include <cstdio> #include <string> #include <sstream> #include <vector> using namespace std; int stoi(std::string str){ int ret; std::stringstream ss; ss<<str; ss>>ret; return ret; } vector<string> split(const string &s, char delim) { vector<string> elems; stringstream ss(s); string item; while (getline(ss, item, delim)) { if (!item.empty()) { elems.push_back(item); } } return elems; } int main() { string Str; vector<string> ans; int a,b; getline(cin, Str); ans = split(Str,' '); a = stoi(ans[0]); b = stoi(ans[2]); if(ans[1]=="+") printf("%d\n",a+b); else printf("%d\n",a-b); return 0; }
a.cc: In function 'int main()': a.cc:42:11: error: call of overloaded 'stoi(__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type&)' is ambiguous 42 | a = stoi(ans[0]); | ~~~~^~~~~~~~ a.cc:9:5: note: candidate: 'int stoi(std::string)' 9 | int stoi(std::string str){ | ^~~~ 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:4164:3: note: candidate: 'int std::__cxx11::stoi(const std::string&, std::size_t*, int)' 4164 | stoi(const string& __str, size_t* __idx = 0, int __base = 10) | ^~~~ a.cc:43:11: error: call of overloaded 'stoi(__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type&)' is ambiguous 43 | b = stoi(ans[2]); | ~~~~^~~~~~~~ a.cc:9:5: note: candidate: 'int stoi(std::string)' 9 | int stoi(std::string str){ | ^~~~ /usr/include/c++/14/bits/basic_string.h:4164:3: note: candidate: 'int std::__cxx11::stoi(const std::string&, std::size_t*, int)' 4164 | stoi(const string& __str, size_t* __idx = 0, int __base = 10) | ^~~~
s193650858
p03844
C
#include <iostream> #include <cstdio> #include <string> #include <sstream> #include <vector> using namespace std; int stoi(std::string str){ int ret; std::stringstream ss; ss<<str; ss>>ret; return ret; } vector<string> split(const string &s, char delim) { vector<string> elems; stringstream ss(s); string item; while (getline(ss, item, delim)) { if (!item.empty()) { elems.push_back(item); } } return elems; } int main() { string Str; vector<string> ans; int a,b; getline(cin, Str); ans = split(Str,' '); a = stoi(ans[0]); b = stoi(ans[2]); if(ans[1]=="+") printf("%d\n",a+b); else printf("%d\n",a-b); return 0; }
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s239085557
p03844
C++
#include <iostream> #include <cstdio> #include <string> #include <sstream> #include <vector> using namespace std; int stoi(std::string str){ int ret; std::stringstream ss; ss<<str; ss>>ret; return ret; } vector<string> split(const string &s, char delim) { vector<string> elems; stringstream ss(s); string item; while (getline(ss, item, delim)) { if (!item.empty()) { elems.push_back(item); } } return elems; } int main() { string Str; vector<string> ans; int a,b; getline(cin, Str); ans = split(Str,' '); a = stoi(ans[0]); b = stoi(ans[2]); if(ans[1]=="+") printf("%d\n",a+b); else printf("%d\n",a-b); return 0; }
a.cc: In function 'int main()': a.cc:42:11: error: call of overloaded 'stoi(__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type&)' is ambiguous 42 | a = stoi(ans[0]); | ~~~~^~~~~~~~ a.cc:9:5: note: candidate: 'int stoi(std::string)' 9 | int stoi(std::string str){ | ^~~~ 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:4164:3: note: candidate: 'int std::__cxx11::stoi(const std::string&, std::size_t*, int)' 4164 | stoi(const string& __str, size_t* __idx = 0, int __base = 10) | ^~~~ a.cc:43:11: error: call of overloaded 'stoi(__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type&)' is ambiguous 43 | b = stoi(ans[2]); | ~~~~^~~~~~~~ a.cc:9:5: note: candidate: 'int stoi(std::string)' 9 | int stoi(std::string str){ | ^~~~ /usr/include/c++/14/bits/basic_string.h:4164:3: note: candidate: 'int std::__cxx11::stoi(const std::string&, std::size_t*, int)' 4164 | stoi(const string& __str, size_t* __idx = 0, int __base = 10) | ^~~~
s694328931
p03844
C++
package main import ( "fmt" ) func main() { var x, y int64 var s string fmt.Scan(&x, &s, &y) var ans int64 if s == "+" { ans = x + y } else { ans = x - y } fmt.Println(ans) } func Min(x, y int64) int64 { if x < y { return x } return y } func Max(x, y int64) int64 { if x > y { return x } return y }
a.cc:1:1: error: 'package' does not name a type 1 | package main | ^~~~~~~ a.cc:20:1: error: 'func' does not name a type 20 | func Min(x, y int64) int64 { | ^~~~ a.cc:27:1: error: 'func' does not name a type 27 | func Max(x, y int64) int64 { | ^~~~
s247488240
p03844
Java
public static void main(String[] args) { // TODO 自動生成されたメソッド・スタブ System.out.print(" "); Scanner sc = new Scanner(System.in); //人数 int N = sc.nextInt(); int[] A = new int[N]; //絶対値の入力 int[] a = new int[N]; double P; for(int i = 0; i < N ;i++){ a[i] = sc.nextInt(); A[i] = Math.abs((2 * i) - N + 1); } Arrays.sort(A); Arrays.sort(a); if(Arrays.equals(A,a)){ P = Math.floor(N/2) * Math.floor(N/2); }else{ P = 0; } System.out.println(P / (Math.pow(10, 9) + 7)); }
Main.java:1: error: unnamed classes are a preview feature and are disabled by default. public static void main(String[] args) { ^ (use --enable-preview to enable unnamed classes) 1 error
s836329258
p03844
C++
#include<iostream> #include<string> using namespace std; string S;int a,b; int main(){ cin>>a>>S>>b; if(S=="+")cout<a+b<<endl; else cout<<a-b<<endl; return 0; }
a.cc: In function 'int main()': a.cc:7:27: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<' 7 | if(S=="+")cout<a+b<<endl; | ~~~^~~~~~
s824985695
p03844
C++
#include <bits/stdc++.h> #include <cstdio> using namespace std; typedef long long ll; const int N=2e3; int main() { char s[N]; while(gets(s)) { int op=0; int a=0,b=0; for(int i=0;i<strlen(s);i++) { if(s[i]==' ') continue; if(s[i]=='+') { op=1; continue; } if(s[i]=='-') { op=2; continue; } if(op==0) a=a*10+s[i]-'0'; else b=b*10+s[i]-'0'; } if(op==1) cout<<ll(a+b)<<endl; else cout<<a-b<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:10:15: error: 'gets' was not declared in this scope; did you mean 'getw'? 10 | while(gets(s)) | ^~~~ | getw
s118225944
p03844
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int N=2e3; int main() { char s[N]; while(gets(s)) { int op=0; int a=0,b=0; for(int i=0;i<strlen(s);i++) { if(s[i]==' ') continue; if(s[i]=='+') { op=1; continue; } if(s[i]=='-') { op=2; continue; } if(op==0) a=a*10+s[i]-'0'; else b=b*10+s[i]-'0'; } if(op==1) cout<<ll(a+b)<<endl; else cout<<a-b<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:9:15: error: 'gets' was not declared in this scope; did you mean 'getw'? 9 | while(gets(s)) | ^~~~ | getw
s921412131
p03844
Java
import java.util.Scanner; public class Main { public static void main(String[] args) { // TODO code application logic here QuestionB a = new QuestionB(); a.print(); } public class QuestionA { private static int a; private static int b; String op; Scanner sc = new Scanner(System.in); public QuestionA() { this.a = sc.nextInt(); this.op = sc.next(); this.b = sc.nextInt(); } public void print(){ int c = 0; switch(op){ case "+": c = a + b; break; case "-": c = a - b; break; case "*": c = a * b; break; case "/": c = a / b; break; } System.out.println(c); } } }
Main.java:6: error: cannot find symbol QuestionB a = new QuestionB(); ^ symbol: class QuestionB location: class Main Main.java:6: error: cannot find symbol QuestionB a = new QuestionB(); ^ symbol: class QuestionB location: class Main 2 errors
s485854813
p03844
C
#include<stdio.h> int main(void) { int A,B,result; char op; scanf("%d %c %d",&A,&op,&B); if(op == '+'); { result = A + B; } else { result = A - B; } printf("%d",result); return 0; }
main.c: In function 'main': main.c:13:2: error: 'else' without a previous 'if' 13 | else | ^~~~
s643511707
p03844
C
#include<stdio.h> int main(void) { int A,B,result; char op; scanf("%d,%s,%d",&A,&op,&B); if(op == "+"); { result = A + B; } else { result = A - B; } printf("%d",result); return 0; }
main.c: In function 'main': main.c:9:7: warning: comparison between pointer and integer 9 | if(op == "+"); | ^~ main.c:13:2: error: 'else' without a previous 'if' 13 | else | ^~~~
s774893185
p03844
C
#include<stdio.h> int main(void) { int A,B,result; char op; scanf("%d,%s,%d",&A,&op,&B); if(op == "+"); { result = A + B; } else { result = A - B; } return 0; }
main.c: In function 'main': main.c:9:7: warning: comparison between pointer and integer 9 | if(op == "+"); | ^~ main.c:13:2: error: 'else' without a previous 'if' 13 | else | ^~~~