submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s495822002
p03844
C++
// // Created by 伊東麻沙美 on 2019/10/22. // #include<iostream> #include<algorithm> using namespace std; int main(){ int i,j; char x; cin<<i<<x<<j; if(x=='+'){ printf("%d",i+j); } if(x=='-'){ printf("%d",i-j); } return 0; }
a.cc: In function 'int main()': a.cc:14:8: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int') 14 | cin<<i<<x<<j; | ~~~^~~ | | | | | int | std::istream {aka std::basic_istream<char>} a.cc:14:8: note: candidate: 'operator<<(int, int)' (built-in) 14 | cin<<i<<x<<j; | ~~~^~~ a.cc:14:8: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'int' 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/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:5: /usr/include/c++/14/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)' 763 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed: a.cc:14:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 14 | cin<<i<<x<<j; | ^ /usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 4077 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed: a.cc:14:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 14 | cin<<i<<x<<j; | ^ In file included from /usr/include/c++/14/bits/memory_resource.h:38, from /usr/include/c++/14/string:68: /usr/include/c++/14/cstddef:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)' 125 | operator<<(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed: a.cc:14:5: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte' 14 | cin<<i<<x<<j; | ^~~ In file included from /usr/include/c++/14/bits/ios_base.h:46: /usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)' 339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e) | ^~~~~~~~ /usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed: a.cc:14:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 14 | cin<<i<<x<<j; | ^ /usr/include/c++/14/ostream:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)' 563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c) | ^~~~~~~~ /usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed: a.cc:14:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 14 | cin<<i<<x<<j; | ^ /usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)' 573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed: a.cc:14:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 14 | cin<<i<<x<<j; | ^ /usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)' 579 | operator<<(basic_ostream<char, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed: a.cc:14:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 14 | cin<<i<<x<<j; | ^ /usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)' 590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed: a.cc:14:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 14 | cin<<i<<x<<j; | ^ /usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)' 595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed: a.cc:14:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 14 | cin<<i<<x<<j; | ^ /usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)' 654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed: a.cc:14:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 14 | cin<<i<<x<<j; | ^ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)' 307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed: a.cc:14:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 14 | cin<<i<<x<<j; | ^ /usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)' 671 | operator<<(basic_ostream<char, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:671:5: note: template argument deduction/substitution failed: a.cc:14:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 14 | cin<<i<<x<<j; | ^ /usr/include/c++/14/ostream:684:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const signed char*)' 684 | operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:684:5: note: template argument deduction/substitution failed: a.cc:14:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 14 | cin<<i<<x<<j; | ^ /usr/include/c++/14/ostream:689:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const unsigned char*)' 689 | operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:689:5: note: template argument deduction/substitution failed: a.cc:14:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 14 | cin<<i<<x<<j; | ^ /usr/include/c++/14/ostream:810:5: note: candidate: 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&)' 810 | operator<<(_Ostream&& __os, const _Tp& __x) | ^~~~~~~~ /usr/include/c++/14/ostream:810:5: note: template argument deduction/substitution failed: /usr/include/c++/14/ostream: In substitution of 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&) [with _Ostream = std::basic_istream<char>&; _Tp = int]': a.cc:14:10: required from here 14 | cin<<i<<x<<j; | ^ /usr/include/c++/14/ostream:810:5: error: no type named 'type' in 'struct std::enable_if<false, void>' 810 | operator<<(_Ostream&& __os, const _Tp& __x) | ^~~~~~~~
s803436431
p03844
C++
include <bits/stdc++.h> using namespace std; int main() { int a, b,ans; char op; cin >> a >> op >> b; if (op == '+') { ans = a + b; } else if (op == '-') { ans = a - b; } cout << ans << endl; }
a.cc:1:1: error: 'include' does not name a type 1 | include <bits/stdc++.h> | ^~~~~~~ a.cc: In function 'int main()': a.cc:7:9: error: 'cin' was not declared in this scope 7 | cin >> a >> op >> b; | ^~~ a.cc:18:9: error: 'cout' was not declared in this scope 18 | cout << ans << endl; | ^~~~ a.cc:18:24: error: 'endl' was not declared in this scope 18 | cout << ans << endl; | ^~~~
s712303883
p03844
C++
#include<iostream> #include<string> #include<algorithm> using namespace std; int main(){ int a,b; string c; cin>>a>>c>>b; (c='+')? cout<<a+b:cout<<a-b; return 0; }
a.cc: In function 'int main()': a.cc:11:5: error: could not convert 'c.std::__cxx11::basic_string<char>::operator=(43)' from 'std::__cxx11::basic_string<char>' to 'bool' 11 | (c='+')? cout<<a+b:cout<<a-b; | ~~^~~~~ | | | std::__cxx11::basic_string<char>
s164934566
p03844
C++
#include<iostream> #include<string> #include<algorithm> using namespace std; int main(){ int a,b; string c; cin>>a>>c>>b; (c=='+')? cout<<a+b:cout<<a-b; return 0; }
a.cc: In function 'int main()': a.cc:11:5: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char') 11 | (c=='+')? cout<<a+b:cout<<a-b; | ~^~~~~ | | | | | 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:11:7: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::fpos<_StateT>' 11 | (c=='+')? cout<<a+b:cout<<a-b; | ^~~ 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:11:7: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::allocator<_CharT>' 11 | (c=='+')? cout<<a+b:cout<<a-b; | ^~~ 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:11:7: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 11 | (c=='+')? cout<<a+b:cout<<a-b; | ^~~ /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:11:7: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 11 | (c=='+')? cout<<a+b:cout<<a-b; | ^~~ /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:11:7: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 11 | (c=='+')? cout<<a+b:cout<<a-b; | ^~~ /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:11:7: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 11 | (c=='+')? cout<<a+b:cout<<a-b; | ^~~ 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:11:7: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>' 11 | (c=='+')? cout<<a+b:cout<<a-b; | ^~~ 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:11:7: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 11 | (c=='+')? cout<<a+b:cout<<a-b; | ^~~ /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:11:7: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 11 | (c=='+')? cout<<a+b:cout<<a-b; | ^~~ /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:11:7: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'char' 11 | (c=='+')? cout<<a+b:cout<<a-b; | ^~~ /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:11:7: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'char' 11 | (c=='+')? cout<<a+b:cout<<a-b; | ^~~ /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:11:7: note: mismatched types 'const _CharT*' and 'char' 11 | (c=='+')? cout<<a+b:cout<<a-b; | ^~~ /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:11:7: note: mismatched types 'const _CharT*' and 'std::__cxx11::basic_string<char>' 11 | (c=='+')? cout<<a+b:cout<<a-b; | ^~~ 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:11:7: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::tuple<_UTypes ...>' 11 | (c=='+')? cout<<a+b:cout<<a-b; | ^~~ 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:11:7: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::istreambuf_iterator<_CharT, _Traits>' 11 | (c=='+')? cout<<a+b:cout<<a-b; | ^~~ 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 | ope
s743101281
p03844
C++
#include<iostream> using namespace std; int main(){ int a,b; char c; cin >> a >> c >> b; if (c=="+"){ return a+b; }else{ return a-b; } return 0; }
a.cc: In function 'int main()': a.cc:7:8: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 7 | if (c=="+"){ | ~^~~~~
s372811422
p03844
C++
#include<stdio.h> int main() { long long int A,B; char C; scanf("%lld %c %lld", &A , &C, &B); if(C=='+') printf("%d\n",A+B); else if(C=='-') printf("%d\n",A-B); else return; }
a.cc: In function 'int main()': a.cc:14:13: error: return-statement with no value, in function returning 'int' [-fpermissive] 14 | return; | ^~~~~~
s700389807
p03844
C++
#include<iosteram> using namespace std; int main(){ int a,b; char c; cin >> a >> c >> b; if(c == '-') cout << a-b; else cout << a+b; }
a.cc:1:9: fatal error: iosteram: No such file or directory 1 | #include<iosteram> | ^~~~~~~~~~ compilation terminated.
s985657817
p03844
C++
#include <bits/stdc++.h> #define REP(i, n) for(ll i = 0; i < (ll)n; i++) #define FOR(i, a, b) for(ll i = (a); i < (ll)b; i++) #define ALL(obj) (obj).begin(), (obj).end() #define INF (1ll << 60) #define sz(x) int(x.size()) using namespace std; typedef long long ll; using vl = vector<ll>; using vvl = vector<vl>; typedef double db; typedef string str; typedef pair<ll, ll> p; constexpr int MOD = 1000000007; using ll = long long; template <class T> inline bool chmin(T &a, T b) { if(a > b) { a = b; return true; } return false; } template <class T> inline bool chmax(T &a, T b) { if(a < b) { a = b; return true; } return false; } void print(const std::vector<int> &v) { std::for_each(v.begin(), v.end(), [](int x) { std::cout << x << " "; }); std::cout << std::endl; } int main() { ll A, B; char op; cin >> A >> cp >> B; if(op == '+') { cout << A + B << endl; return 0; } else { cout << A - B << endl; } }
a.cc: In function 'int main()': a.cc:39:17: error: 'cp' was not declared in this scope; did you mean 'op'? 39 | cin >> A >> cp >> B; | ^~ | op
s673855840
p03844
C++
#include <bits/stdc++.h> #define REP(i, n) for(ll i = 0; i < (ll)n; i++) #define FOR(i, a, b) for(ll i = (a); i < (ll)b; i++) #define ALL(obj) (obj).begin(), (obj).end() #define INF (1ll << 60) #define sz(x) int(x.size()) using namespace std; typedef long long ll; using vl = vector<ll>; using vvl = vector<vl>; typedef double db; typedef string str; typedef pair<ll, ll> p; constexpr int MOD = 1000000007; using ll = long long; template <class T> inline bool chmin(T &a, T b) { if(a > b) { a = b; return true; } return false; } template <class T> inline bool chmax(T &a, T b) { if(a < b) { a = b; return true; } return false; } void print(const std::vector<int> &v) { std::for_each(v.begin(), v.end(), [](int x) { std::cout << x << " "; }); std::cout << std::endl; } int main() { ll A, B; char op; cin >> A >> cp >> B; if(op == '+') { cout << A + B << endl; reutrn 0; } else { cout << A - B << endl; } }
a.cc: In function 'int main()': a.cc:39:17: error: 'cp' was not declared in this scope; did you mean 'op'? 39 | cin >> A >> cp >> B; | ^~ | op a.cc:42:9: error: 'reutrn' was not declared in this scope 42 | reutrn 0; | ^~~~~~
s967205708
p03844
C++
#include <bits/stdc++.h> #define REP(i, n) for(ll i = 0; i < (ll)n; i++) #define FOR(i, a, b) for(ll i = (a); i < (ll)b; i++) #define ALL(obj) (obj).begin(), (obj).end() #define INF (1ll << 60) #define sz(x) int(x.size()) using namespace std; typedef long long ll; using vl = vector<ll>; using vvl = vector<vl>; typedef double db; typedef string str; typedef pair<ll, ll> p; constexpr int MOD = 1000000007; using ll = long long; template <class T> inline bool chmin(T &a, T b) { if(a > b) { a = b; return true; } return false; } template <class T> inline bool chmax(T &a, T b) { if(a < b) { a = b; return true; } return false; } void print(const std::vector<int> &v) { std::for_each(v.begin(), v.end(), [](int x) { std::cout << x << " "; }); std::cout << std::endl; } int main() { ll A ,B; char op; cin>>A>>cp>>B; if(op=='+'){ cout<<A+B<<end; reutrn 0; }else{ cout<<A-B<<endl; } }
a.cc: In function 'int main()': a.cc:39:13: error: 'cp' was not declared in this scope; did you mean 'op'? 39 | cin>>A>>cp>>B; | ^~ | op a.cc:41:18: error: no match for 'operator<<' (operand types are 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} and '<unresolved overloaded function type>') 41 | cout<<A+B<<end; | ~~~~~~~~~^~~~~ 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, from a.cc:1: /usr/include/c++/14/ostream:116:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:116:36: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'} 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:125:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]' 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:125:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:135:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ^~~~~~~~ /usr/include/c++/14/ostream:135:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::ios_base& (*)(std::ios_base&)' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 174 | operator<<(long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:174:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long int' 174 | operator<<(long __n) | ~~~~~^~~ /usr/include/c++/14/ostream:178:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 178 | operator<<(unsigned long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:178:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long unsigned int' 178 | operator<<(unsigned long __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:182:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 182 | operator<<(bool __n) | ^~~~~~~~ /usr/include/c++/14/ostream:182:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'bool' 182 | operator<<(bool __n) | ~~~~~^~~ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:96:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]' 96 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:97:22: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short int' 97 | operator<<(short __n) | ~~~~~~^~~ /usr/include/c++/14/ostream:189:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 189 | operator<<(unsigned short __n) | ^~~~~~~~ /usr/include/c++/14/ostream:189:33: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short unsigned int' 189 | operator<<(unsigned short __n) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/ostream.tcc:110:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]' 110 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:111:20: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'int' 111 | operator<<(int __n) | ~~~~^~~ /usr/include/c++/14/ostream:200:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 200 | operator<<(unsigned int __n) | ^~~~~~~~ /usr/include/c++/14/ostream:200:31: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'unsigned int' 200 | operator<<(unsigned int __n) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:211:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 211 | operator<<(long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:211:28: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long int' 211 | operator<<(long long __n) | ~~~~~~~~~~^~~ /usr/include/c++/14/ostream:215:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 215 | operator<<(unsigned long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:215:37: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long unsigned int' 215 | operator<<(unsigned long long __n) | ~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:231:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 231 | operator<<(double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:231:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'double' 231 | operator<<(double __f) | ~~~~~~~^~~ /usr/include/c++/14/ostream:235:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 235 | operator<<(float __f) | ^~~~~~~~ /usr/include/c++/14/ostream:235:24: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'float' 235 | operator<<(float __f) | ~~~~~~^~~ /usr/include/c++/14/ostream:243:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 243 | operator<<(long double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:243:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long double' 243 | operator<<(long double __f) | ~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:301:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 301 | operator<<(const void* __p) | ^~~~~~~~ /usr/include/c++/14/ostream:301:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'const void*' 301 | operator<<(const void* __p) | ~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:306:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_
s422459342
p03844
C++
#include<iostream> using namespace std; int main(){ int a, b; char op; cin >> a >> op >> b; int ans; if(op == '+' ans = a+b; else ans = a-b; cout << ans; return 0; }
a.cc: In function 'int main()': a.cc:9:15: error: expected ';' before 'ans' 9 | if(op == '+' | ^ | ; 10 | ans = a+b; | ~~~ a.cc:11:3: error: expected primary-expression before 'else' 11 | else | ^~~~ a.cc:10:15: error: expected ')' before 'else' 10 | ans = a+b; | ^ | ) 11 | else | ~~~~ a.cc:9:5: note: to match this '(' 9 | if(op == '+' | ^
s537997065
p03844
C
#include<stdio.h> int main() { long long int a, b; char ch; scanf("%lld", &a); scanf("%c", &ch); scanf("%lld", &b); if (ch == '+') { printf("%lld\n", a + b); } else if { printf("%lld\n", a - b); } return 0; }
main.c: In function 'main': main.c:14:18: error: expected '(' before '{' token 14 | else if { | ^ | (
s251304780
p03844
C
#include<stdio.h> int main() { int a, b; char s; scanf("%d", &a); scanf("%c", &s); scanf("%d", &b); if (s == +) { printf("%d\n", a + b); } if (s == -) { printf("%d\n", a - b); } return 0; }
main.c: In function 'main': main.c:11:19: error: expected expression before ')' token 11 | if (s == +) { | ^ main.c:14:19: error: expected expression before ')' token 14 | if (s == -) { | ^
s093547700
p03844
Java
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int num1 = Integer.parseInt(sc.next()); String op = sc.next(); int num1 = Integer.parseInt(sc.next()); if ("+".equals(op)) { System.out.println(num1 + num2); } else { System.out.println(num1 - num2); } } }
Main.java:8: error: variable num1 is already defined in method main(String[]) int num1 = Integer.parseInt(sc.next()); ^ Main.java:10: error: cannot find symbol System.out.println(num1 + num2); ^ symbol: variable num2 location: class Main Main.java:12: error: cannot find symbol System.out.println(num1 - num2); ^ symbol: variable num2 location: class Main 3 errors
s790008670
p03844
C++
#include <bits/stdc++.h> using namespace std; int main() { int a; string op; int b; if (op == '+') { cout << a+b<< endl; } else { cout << a-b << endl; } }
a.cc: In function 'int main()': a.cc:8:10: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char') 8 | if (op == '+') { | ~~ ^~ ~~~ | | | | | 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:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 8 | if (op == '+') { | ^~~ /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:13: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char' 8 | if (op == '+') { | ^~~ /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:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 8 | if (op == '+') { | ^~~ /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:13: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char' 8 | if (op == '+') { | ^~~ /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:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 8 | if (op == '+') { | ^~~ /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:13: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char' 8 | if (op == '+') { | ^~~ /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:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 8 | if (op == '+') { | ^~~ /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:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::match_results<_BiIter, _Alloc>' 8 | if (op == '+') { | ^~~ 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:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>' 8 | if (op == '+') { | ^~~ 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:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 8 | 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:8:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 8 | 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:8:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 8 | 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:8:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 8 | if (op == '+') { | ^~~ 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:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::fpos<_StateT>' 8 | if (op == '+') { | ^~~ 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:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::allocator<_CharT>' 8 | 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:8:13: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 8 | if (op == '+') { | ^~~ /usr/include/c++/14/string_view:637:5: note: candidate: 'template<class _Cha
s053139527
p03844
C++
#include <bits/stdc++.h> using namespace std; int main(){ int A, B; cin>>A>>B; char op; cin>>op; if(op = '+'){ cout<<A+B<<endl; else{ cout<<A-B<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:10:5: error: expected '}' before 'else' 10 | else{ | ^~~~ a.cc:8:13: note: to match this '{' 8 | if(op = '+'){ | ^
s500585166
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; else { cout<<a-b;
a.cc: In function 'int main()': a.cc:10:15: error: expected '}' at end of input 10 | cout<<a-b; | ^ a.cc:9:6: note: to match this '{' 9 | else { | ^ a.cc:10:15: error: expected '}' at end of input 10 | cout<<a-b; | ^ a.cc:3:12: note: to match this '{' 3 | int main (){ | ^
s704502828
p03844
C++
#include<iostream> #define rep(i,n) for(int i=0; i<(n); i++) using namespace std; typedef long long ll; int main(){ string S; int a, b; 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:10:9: error: could not convert 'S.std::__cxx11::basic_string<char>::operator=(43)' from 'std::__cxx11::basic_string<char>' to 'bool' 10 | if(S='+'){ | ~^~~~ | | | std::__cxx11::basic_string<char>
s959055815
p03844
C++
#include <iostream> #include <iomanip> #include <vector> #include <cmath> #include <algorithm> #include <iomanip> #include <cstring> #include <map> #define rep(i, N) for (int i = 0; i < (int)N; i++) using namespace std; typedef long long ll; const ll LLINF = 9223372036854775807; const int MOD = 1000000007; int main() { int A, B; string op; cin >> A >> op >> B; int result = string=="+" ? A+B : A-B; cout << result << endl; return 0; }
a.cc: In function 'int main()': a.cc:18:22: error: expected primary-expression before '==' token 18 | int result = string=="+" ? A+B : A-B; | ^~
s707570875
p03844
C++
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep2(i, s, n) for (int i = (s); i < (int)(n); i++) typedef long long ll; int main() { int A, B; char op; cin >> A >> op >> b; if (op == '+'){ cout << A + B << endl; } else { cout << A - B << endl; } }
a.cc: In function 'int main()': a.cc:10:23: error: 'b' was not declared in this scope 10 | cin >> A >> op >> b; | ^
s470829938
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 ; if(op == '-') cout << A - B }
a.cc: In function 'int main()': a.cc:11:16: error: expected ';' before '}' token 11 | cout << A - B | ^ | ; 12 | } | ~
s519599261
p03844
C++
using namespace std; int main(){ int a, b; char c; cin >> a >> c >> b; if(c == 'char') cout << a + b << endl; else cout << a - b << endl; return 0; }
a.cc:7:11: warning: multi-character character constant [-Wmultichar] 7 | if(c == 'char') 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 >> c >> b; | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | using namespace std; a.cc:7:19: error: 'cout' was not declared in this scope 7 | if(c == 'char') cout << a + b << endl; | ^~~~ a.cc:7:19: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:7:36: error: 'endl' was not declared in this scope 7 | if(c == 'char') cout << a + b << endl; | ^~~~ a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' +++ |+#include <ostream> 1 | using namespace std; a.cc:8:8: error: 'cout' was not declared in this scope 8 | else cout << a - b << endl; | ^~~~ a.cc:8:8: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:8:25: error: 'endl' was not declared in this scope 8 | else cout << a - b << endl; | ^~~~ a.cc:8:25: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
s545130557
p03844
C++
using namespace std; int main(){ int a, b; string c; cin >> a >> c >> b; if(c == "+") cout << a + b << endl; else cout << a - b << endl; return 0; }
a.cc: In function 'int main()': a.cc:5:3: error: 'string' was not declared in this scope 5 | string c; | ^~~~~~ a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>' +++ |+#include <string> 1 | using namespace std; a.cc:6:3: error: 'cin' was not declared in this scope 6 | cin >> a >> c >> b; | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | using namespace std; a.cc:6:15: error: 'c' was not declared in this scope 6 | cin >> a >> c >> b; | ^ a.cc:7:16: error: 'cout' was not declared in this scope 7 | if(c == "+") cout << a + b << endl; | ^~~~ a.cc:7:16: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:7:33: error: 'endl' was not declared in this scope 7 | if(c == "+") cout << a + b << endl; | ^~~~ a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' +++ |+#include <ostream> 1 | using namespace std; a.cc:8:8: error: 'cout' was not declared in this scope 8 | else cout << a - b << endl; | ^~~~ a.cc:8:8: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:8:25: error: 'endl' was not declared in this scope 8 | else cout << a - b << endl; | ^~~~ a.cc:8:25: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
s345318303
p03844
C++
using namespace std; int main(){ int a, b; string c; cin >> a >> c >> b; if(c == '+') cout << a + b << endl; else cout << a - b << endl; return 0; }
a.cc: In function 'int main()': a.cc:5:3: error: 'string' was not declared in this scope 5 | string c; | ^~~~~~ a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>' +++ |+#include <string> 1 | using namespace std; a.cc:6:3: error: 'cin' was not declared in this scope 6 | cin >> a >> c >> b; | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | using namespace std; a.cc:6:15: error: 'c' was not declared in this scope 6 | cin >> a >> c >> b; | ^ a.cc:7:16: error: 'cout' was not declared in this scope 7 | if(c == '+') cout << a + b << endl; | ^~~~ a.cc:7:16: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:7:33: error: 'endl' was not declared in this scope 7 | if(c == '+') cout << a + b << endl; | ^~~~ a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' +++ |+#include <ostream> 1 | using namespace std; a.cc:8:8: error: 'cout' was not declared in this scope 8 | else cout << a - b << endl; | ^~~~ a.cc:8:8: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:8:25: error: 'endl' was not declared in this scope 8 | else cout << a - b << endl; | ^~~~ a.cc:8:25: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
s671028568
p03844
C++
#include <bits/stdc++.h> #define rep(i, a, n) for (int i = (int)(a); i <= (int)(n); ++i) #define rrep(i, a, n) for (int i = (int)(a); i >= (int)(n); --i) #define debug(x) cerr << #x << " = " << x << "\n" #define debugv(x) \ rep(f, 0, (x.size() - 1)) cerr << x[f] << (f == (x.size() - 1) ? "\n" : " ") #define all(x) x.begin(), x.end() #define int long long using namespace std; typedef pair<int, int> pii; typedef vector<int> vi; const int MX = 1e5 + 5, INF = 5 << 28, MOD = 1e9 + 7; int N, M, K; vi A, B; string S, T; void input() { int x, y, z; cin >> N >> S >> M; ; } void solve() { if (S == '+') { cout << N + M << endl; } else { cout << N - M << endl; }; ; } signed main() { input(); solve(); return 0; }
a.cc: In function 'void solve()': a.cc:24:9: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char') 24 | 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:24:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 24 | 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:24:12: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char' 24 | 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:24:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 24 | 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:24:12: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char' 24 | 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:24:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 24 | 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:24:12: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char' 24 | 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:24:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 24 | 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:24:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::match_results<_BiIter, _Alloc>' 24 | 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:24:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>' 24 | 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:24:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 24 | 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:24:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 24 | 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:24:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 24 | 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:24:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 24 | 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:24:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::fpos<_StateT>' 24 | 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:24:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::allocator<_CharT>' 24 | 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:24:12: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 24 | if (S == '+') { | ^~~ /usr/include/c++/14/string_view:637:5: note: candidate: 'template<class _CharT, class _Traits>
s629106273
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; } else { cout << A-B; } }
a.cc: In function 'int main()': a.cc:5:10: error: found ':' in nested-name-specifier, expected '::' 5 | char op: | ^ | :: a.cc:5:8: error: 'op' has not been declared 5 | char op: | ^~ a.cc:6:7: error: qualified-id in declaration before '>>' token 6 | cin >> A >> op >> B; | ^~ a.cc:7:7: error: 'op' was not declared in this scope 7 | if (op == '+'){ | ^~
s824196001
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 if(op == -){ cout << A - B << endl; } }
a.cc: In function 'int main()': a.cc:8:11: error: expected primary-expression before ')' token 8 | if(op == +){ | ^ a.cc:11:16: error: expected primary-expression before ')' token 11 | else if(op == -){ | ^
s554441807
p03844
C++
#include<bits/stdc++.h> using namespace std; int a,b; string c; int main(){ cin>>a>>c>>b; if(c=='+')cout<<a+b<<endl; else cout<<a-b<<endl;}
a.cc: In function 'int main()': a.cc:7:5: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char') 7 | if(c=='+')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:7:7: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 7 | if(c=='+')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:7:7: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char' 7 | if(c=='+')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:7:7: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 7 | if(c=='+')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:7:7: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char' 7 | if(c=='+')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:7:7: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 7 | if(c=='+')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:7:7: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char' 7 | if(c=='+')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:7:7: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 7 | if(c=='+')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:7:7: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::match_results<_BiIter, _Alloc>' 7 | if(c=='+')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:7:7: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>' 7 | if(c=='+')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:7:7: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 7 | if(c=='+')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:7:7: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 7 | if(c=='+')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:7:7: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 7 | if(c=='+')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:7:7: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 7 | if(c=='+')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:7:7: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::fpos<_StateT>' 7 | if(c=='+')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:7:7: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::allocator<_CharT>' 7 | if(c=='+')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:7:7: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 7 | if(c=='+')cout<<a+b<<endl; | ^~~ /usr/include/c++/14/string_view:637:5: note: candidate: 'template<class _C
s585444121
p03844
C++
#include<iostream> using namespace std; int main(){ int a,b; char p; cin>>a>>p>>b; if(p=="+") cout<<a+b; else cout<<a-b; return 0; }
a.cc: In function 'int main()': a.cc:8:7: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 8 | if(p=="+") | ~^~~~~
s571760874
p03844
C++
#include<bits/stc++.h> using namespace std; #define int long long #define sz(x) (int)(x.size()) signed main() { int a, op, b; cin >> a >> op >> b; if (op == '+') cout << a + b << "\n"; else cout << a - b << "\n"; }
a.cc:1:9: fatal error: bits/stc++.h: No such file or directory 1 | #include<bits/stc++.h> | ^~~~~~~~~~~~~~ compilation terminated.
s455181792
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:7:12: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char') 7 | 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:7:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 7 | 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:7:15: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char' 7 | 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:7:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 7 | 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:7:15: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char' 7 | 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:7:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 7 | 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:7:15: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char' 7 | 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:7:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 7 | 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:7:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::match_results<_BiIter, _Alloc>' 7 | 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:7:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>' 7 | 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:7:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 7 | 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:7:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 7 | 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:7:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 7 | 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:7:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 7 | 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:7:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::fpos<_StateT>' 7 | 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:7:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::allocator<_CharT>' 7 | 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 | opera
s717059404
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; }
a.cc: In function 'int main()': a.cc:7:11: error: no match for 'operator==' (operand types are 'std::basic_ostream<char>' and 'const char [2]') 7 | cout<<op=="+"?a+b:a-b; | ~~~~~~~~^~~~~ | | | | | const char [2] | std::basic_ostream<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:7:13: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>' 7 | cout<<op=="+"?a+b:a-b; | ^~~ /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:7:13: note: 'std::basic_ostream<char>' is not derived from 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>' 7 | cout<<op=="+"?a+b:a-b; | ^~~ /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:7:13: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>' 7 | cout<<op=="+"?a+b:a-b; | ^~~ /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:7:13: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'const char [2]' 7 | cout<<op=="+"?a+b:a-b; | ^~~ /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:7:13: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>' 7 | cout<<op=="+"?a+b:a-b; | ^~~ /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:7:13: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'const char [2]' 7 | cout<<op=="+"?a+b:a-b; | ^~~ /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:7:13: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>' 7 | cout<<op=="+"?a+b:a-b; | ^~~ /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:7:13: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::match_results<_BiIter, _Alloc>' 7 | cout<<op=="+"?a+b:a-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: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:7:13: note: 'std::basic_ostream<char>' is not derived from 'const std::pair<_T1, _T2>' 7 | cout<<op=="+"?a+b:a-b; | ^~~ 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:7:13: note: 'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>' 7 | cout<<op=="+"?a+b:a-b; | ^~~ /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:7:13: note: 'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>' 7 | cout<<op=="+"?a+b:a-b; | ^~~ /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:7:13: note: 'std::basic_ostream<char>' is not derived from 'const std::move_iterator<_IteratorL>' 7 | cout<<op=="+"?a+b:a-b; | ^~~ /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:7:13: note: 'std::basic_ostream<char>' is not derived from 'const std::move_iterator<_IteratorL>' 7 | cout<<op=="+"?a+b:a-b; | ^~~ 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:7:13: note: 'std::basic_ostream<char>' is not derived from 'const std::fpos<_StateT>' 7 | cout<<op=="+"?a+b:a-b; | ^~~ 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:7:13: note: 'std::basic_ostream<char>' is not derived from 'const std::allocator<_CharT>' 7 | cout<<op=="+"?a+b:a-b; | ^~~ 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:7:13: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 7 | cout<<op=="+"?a+b:a-b; | ^~~ /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, | ^~~~~~~~ /us
s534088969
p03844
C++
#include <bits/stdc++.h> int main(){ int a,b; string op; cin>>a>>op>>b; cout<<op=="+"?a+b:a-b; }
a.cc: In function 'int main()': a.cc:4:3: error: 'string' was not declared in this scope 4 | string op; | ^~~~~~ a.cc:4:3: note: suggested alternatives: In file included from /usr/include/c++/14/string:41, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52, from a.cc:1: /usr/include/c++/14/bits/stringfwd.h:77:33: note: 'std::string' 77 | typedef basic_string<char> string; | ^~~~~~ /usr/include/c++/14/string:76:11: note: 'std::pmr::string' 76 | using string = basic_string<char>; | ^~~~~~ a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 5 | cin>>a>>op>>b; | ^~~ | std::cin In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:5:11: error: 'op' was not declared in this scope 5 | cin>>a>>op>>b; | ^~ a.cc:6:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 6 | cout<<op=="+"?a+b:a-b; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~
s639979111
p03844
C
#include <stdio.h> int main(void) { int num1; char num2; int num3; scanf_s("%d %c %d",num1,num2,num3); if(num2 == '+'){ printf("%d\n",num1 + num3); } else if(num2 == '-'){ printf("%d\n",num1 - num3); } return 0; }
main.c: In function 'main': main.c:9:3: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration] 9 | scanf_s("%d %c %d",num1,num2,num3); | ^~~~~~~ | scanf
s662138942
p03844
C++
#include<iostream> using namespace std; int main() { int a; char op; int b; std::cin >> a; std::cin >> op; std::cin >> b; if ( op == "+") { std::cout << a+b << '\n'; /* code */ } else { std::cout << a-b << '\n'; } return 0; }
a.cc: In function 'int main()': a.cc:12:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 12 | if ( op == "+") { | ~~~^~~~~~
s344274126
p03844
C
int main(void) { int num1; char str[10]; char str1[10]; char str2[10]; int num3; fgets(str,10,stdin); sscanf(str,"%d", &num1); fgets(str,10,stdin); fgets(str2, 10, stdin); sscanf(str2,"%d", &num3); if (str1 == '+') { printf("%d\n", num1+num3); } else if (str1 == '-') { printf("%d\n", num1-num3); } return 0; }
main.c: In function 'main': main.c:9:9: error: implicit declaration of function 'fgets' [-Wimplicit-function-declaration] 9 | fgets(str,10,stdin); | ^~~~~ main.c:9:22: error: 'stdin' undeclared (first use in this function) 9 | fgets(str,10,stdin); | ^~~~~ main.c:1:1: note: 'stdin' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>' +++ |+#include <stdio.h> 1 | int main(void) main.c:9:22: note: each undeclared identifier is reported only once for each function it appears in 9 | fgets(str,10,stdin); | ^~~~~ main.c:10:9: error: implicit declaration of function 'sscanf' [-Wimplicit-function-declaration] 10 | sscanf(str,"%d", &num1); | ^~~~~~ main.c:10:9: note: include '<stdio.h>' or provide a declaration of 'sscanf' main.c:10:9: warning: incompatible implicit declaration of built-in function 'sscanf' [-Wbuiltin-declaration-mismatch] main.c:10:9: note: include '<stdio.h>' or provide a declaration of 'sscanf' main.c:17:18: warning: comparison between pointer and integer 17 | if (str1 == '+') { | ^~ main.c:18:17: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 18 | printf("%d\n", num1+num3); | ^~~~~~ main.c:18:17: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:18:17: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:18:17: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:20:23: warning: comparison between pointer and integer 20 | else if (str1 == '-') { | ^~ main.c:21:17: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] 21 | printf("%d\n", num1-num3); | ^~~~~~ main.c:21:17: note: include '<stdio.h>' or provide a declaration of 'printf'
s248813635
p03844
C
int main(void) { int num1; char str[10]; char str1[10]; char str2[10]; int num3; fgets(str,10,stdin); sscanf(str,"%d", &num1); fgets(str,10,stdin); fgets(str2, 10, stdin); sscanf(str2,"%d", &num3); if (str1 == '+') { printf("%d\n", num1+num3); } else if (str1 == '-') { printf("%d\n", num1-num3); } return 0; }
main.c: In function 'main': main.c:9:9: error: implicit declaration of function 'fgets' [-Wimplicit-function-declaration] 9 | fgets(str,10,stdin); | ^~~~~ main.c:9:22: error: 'stdin' undeclared (first use in this function) 9 | fgets(str,10,stdin); | ^~~~~ main.c:1:1: note: 'stdin' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>' +++ |+#include <stdio.h> 1 | int main(void) main.c:9:22: note: each undeclared identifier is reported only once for each function it appears in 9 | fgets(str,10,stdin); | ^~~~~ main.c:10:9: error: implicit declaration of function 'sscanf' [-Wimplicit-function-declaration] 10 | sscanf(str,"%d", &num1); | ^~~~~~ main.c:10:9: note: include '<stdio.h>' or provide a declaration of 'sscanf' main.c:10:9: warning: incompatible implicit declaration of built-in function 'sscanf' [-Wbuiltin-declaration-mismatch] main.c:10:9: note: include '<stdio.h>' or provide a declaration of 'sscanf' main.c:17:18: warning: comparison between pointer and integer 17 | if (str1 == '+') { | ^~ main.c:18:17: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 18 | printf("%d\n", num1+num3); | ^~~~~~ main.c:18:17: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:18:17: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:18:17: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:20:23: warning: comparison between pointer and integer 20 | else if (str1 == '-') { | ^~ main.c:21:17: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] 21 | printf("%d\n", num1-num3); | ^~~~~~ main.c:21:17: note: include '<stdio.h>' or provide a declaration of 'printf'
s156053218
p03844
C
#include <stdio.h> int main(void) { int num; char num2; int num3; scanf("%d",&num); scanf("%c",&num2); scanf("%d",&num3); if(num2 == '+'){ printf("%d\n",num1 + num3); } else if(num2 == '-'){ printf("%d\n",num1 - num3); } return 0; } #include <stdio.h> int main(void) { int num; char num2; int num3; scanf("%d",&num1); scanf("%c",&num2); scanf("%d",&num3); if(num2 == '+'){ printf("%d\n",num1 + num3); } else if(num2 == '-'){ printf("%d\n",num1 - num3); } return 0; }
main.c: In function 'main': main.c:14:19: error: 'num1' undeclared (first use in this function); did you mean 'num3'? 14 | printf("%d\n",num1 + num3); | ^~~~ | num3 main.c:14:19: note: each undeclared identifier is reported only once for each function it appears in main.c: At top level: main.c:24:5: error: redefinition of 'main' 24 | int main(void) | ^~~~ main.c:3:5: note: previous definition of 'main' with type 'int(void)' 3 | int main(void) | ^~~~ main.c: In function 'main': main.c:30:15: error: 'num1' undeclared (first use in this function); did you mean 'num3'? 30 | scanf("%d",&num1); | ^~~~ | num3
s778442769
p03844
C
#include <stdio.h> int main(void) { int num; char num2; int num3; scanf("%d",&num); scanf("%c",&num2); scanf("%d",&num3); if(num2 == '+'){ printf("%d\n",num1 + num3); } else if(num2 == '-'){ printf("%d\n",num1 - num3); } return 0; }
main.c: In function 'main': main.c:14:19: error: 'num1' undeclared (first use in this function); did you mean 'num3'? 14 | printf("%d\n",num1 + num3); | ^~~~ | num3 main.c:14:19: note: each undeclared identifier is reported only once for each function it appears in
s122424914
p03844
C
int main(void) { int num; char num2; int num3; scanf("%d",&num); scanf("%c",&num2); scanf("%d",&num3); if(num2 == '+'){ printf("%d",num1 + num3); } else{ printf("%d",num1 - num3); } return 0; }
main.c: In function 'main': main.c:7:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 7 | scanf("%d",&num); | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | int main(void) main.c:7:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 7 | scanf("%d",&num); | ^~~~~ main.c:7:3: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:12:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 12 | printf("%d",num1 + num3); | ^~~~~~ main.c:12:5: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:12:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:12:5: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:12:17: error: 'num1' undeclared (first use in this function); did you mean 'num3'? 12 | printf("%d",num1 + num3); | ^~~~ | num3 main.c:12:17: note: each undeclared identifier is reported only once for each function it appears in main.c:15:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] 15 | printf("%d",num1 - num3); | ^~~~~~ main.c:15:5: note: include '<stdio.h>' or provide a declaration of 'printf'
s025897851
p03844
C
#include <stdio.h> int main(void) { int num; char num2; int num3; scanf("%d",&num); scanf("%c",&num2); scanf("%d",&num3); if(num2 == '+'){ printf("%d\n",num1 + num3); } else{ printf("%d\n",num1 - num3); } return 0; }
main.c: In function 'main': main.c:14:19: error: 'num1' undeclared (first use in this function); did you mean 'num3'? 14 | printf("%d\n",num1 + num3); | ^~~~ | num3 main.c:14:19: note: each undeclared identifier is reported only once for each function it appears in
s167802163
p03844
C
#include <stdio.h> int main(void) { int num; char num2; int num3; scanf("%d",&num); scanf("%c",&num2); scanf("%d",&num3); if(num2 == '+'){ printf("%d\n",num1 + num3); } else if(num2 == '-'){ printf("%d\n",num1 - num3); } else { puts(""); } return 0; }
main.c: In function 'main': main.c:14:19: error: 'num1' undeclared (first use in this function); did you mean 'num3'? 14 | printf("%d\n",num1 + num3); | ^~~~ | num3 main.c:14:19: note: each undeclared identifier is reported only once for each function it appears in
s624012200
p03844
C
#include <stdio.h> int main(void) { int num; char num2; int num3; scanf("%d",&num); scanf("%c",&num2); scanf("%d",&num3); if(num2 == '+'){ printf("%d\n",num1 + num3); } else if(num2 == '-'){ printf("%d\n",num1 - num3); } return 0; }
main.c: In function 'main': main.c:14:19: error: 'num1' undeclared (first use in this function); did you mean 'num3'? 14 | printf("%d\n",num1 + num3); | ^~~~ | num3 main.c:14:19: note: each undeclared identifier is reported only once for each function it appears in
s392543848
p03844
C
int main(void) { int num; char num2; int num3; scanf("%d",&num); scanf("%c",&num2); scanf("%d",&num3); if(num2 == '+'){ printf("%d\n",num1 + num3); } else if(num2 == '-'){ printf("%d\n",num1 - num3); } return 0; }
main.c: In function 'main': main.c:7:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 7 | scanf("%d",&num); | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | int main(void) main.c:7:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 7 | scanf("%d",&num); | ^~~~~ main.c:7:3: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:12:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 12 | printf("%d\n",num1 + num3); | ^~~~~~ main.c:12:5: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:12:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:12:5: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:12:19: error: 'num1' undeclared (first use in this function); did you mean 'num3'? 12 | printf("%d\n",num1 + num3); | ^~~~ | num3 main.c:12:19: note: each undeclared identifier is reported only once for each function it appears in main.c:15:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] 15 | printf("%d\n",num1 - num3); | ^~~~~~ main.c:15:5: note: include '<stdio.h>' or provide a declaration of 'printf'
s324344697
p03844
C
#include<stdio.h> int main(void) { int num; char num2; int num3; scanf("%d",&num); scanf("%c",&num2); scanf("%d",&num3); if(num2 == '+'){ printf("%d\n",num1 + num3); } else if(num2 == '-'){ printf("%d\n",num1 + num3); } return 0; } #include<stdio.h> int main(void) { int num; char num2; int num3; scanf("%d",&num); scanf("%c",&num2); scanf("%d",&num3); if(num2 == '+'){ printf("%d\n",num1 + num3); } else if(num2 == '-'){ printf("%d\n",num1 - num3); } return 0; }
main.c: In function 'main': main.c:14:19: error: 'num1' undeclared (first use in this function); did you mean 'num3'? 14 | printf("%d\n",num1 + num3); | ^~~~ | num3 main.c:14:19: note: each undeclared identifier is reported only once for each function it appears in main.c: At top level: main.c:24:5: error: redefinition of 'main' 24 | int main(void) | ^~~~ main.c:3:5: note: previous definition of 'main' with type 'int(void)' 3 | int main(void) | ^~~~ main.c: In function 'main': main.c:35:19: error: 'num1' undeclared (first use in this function); did you mean 'num3'? 35 | printf("%d\n",num1 + num3); | ^~~~ | num3
s795551223
p03844
C
#include <stdio.h> int main(void) { int num; char num2; int num3; scanf("%d",&num); scanf("%c",&num2); scanf("%d",&num3); if(num2 == '+'){ printf("%d\n",num1 + num3); } else if(num2 == '-'){ printf("%d\n",num1 + num3); } return 0; }
main.c: In function 'main': main.c:14:19: error: 'num1' undeclared (first use in this function); did you mean 'num3'? 14 | printf("%d\n",num1 + num3); | ^~~~ | num3 main.c:14:19: note: each undeclared identifier is reported only once for each function it appears in
s959480080
p03844
C
#include<stdio.h> int main(void) { int num; char num2; int num3; scanf("%d",&num); scanf("%c",&num2); scanf("%d",&num3); if(num2 == '+'){ printf("%d\n",num1 + num3); } else if(num2 == '-'){ printf("%d\n",num1 + num3); } return 0; } #include<stdio.h> int main(void) { int num; char num2; int num3; scanf("%d",&num); scanf("%c",&num2); scanf("%d",&num3); if(num2 == '+'){ printf("%d\n",num1 + num3); } else if(num2 == '-'){ printf("%d\n",num1 - num3); } return 0; }
main.c: In function 'main': main.c:14:19: error: 'num1' undeclared (first use in this function); did you mean 'num3'? 14 | printf("%d\n",num1 + num3); | ^~~~ | num3 main.c:14:19: note: each undeclared identifier is reported only once for each function it appears in main.c: At top level: main.c:24:5: error: redefinition of 'main' 24 | int main(void) | ^~~~ main.c:3:5: note: previous definition of 'main' with type 'int(void)' 3 | int main(void) | ^~~~ main.c: In function 'main': main.c:35:19: error: 'num1' undeclared (first use in this function); did you mean 'num3'? 35 | printf("%d\n",num1 + num3); | ^~~~ | num3
s909783867
p03844
C
#include<stdio.h> int main(void) { int num; char num2; int num3; scanf("%d",&num); scanf("%c",&num2); scanf("%d",&num3); if(num2 == '+'){ printf("%d\n",num1 + num3); } else if(num2 == '-'){ printf("%d\n",num1 + num3); } return 0; }
main.c: In function 'main': main.c:14:19: error: 'num1' undeclared (first use in this function); did you mean 'num3'? 14 | printf("%d\n",num1 + num3); | ^~~~ | num3 main.c:14:19: note: each undeclared identifier is reported only once for each function it appears in
s015610186
p03844
C
#include<stdio.h> int main(void) { int num; char num2; int num3; scanf("%d",&num); scanf("%c",&num2); scanf("%d",&num3); if(num2 == '+'){ printf("%d\n",num1 + num3); } if(num2 == '-'){ printf("%d\n",num1 + num3); } return 0; }
main.c: In function 'main': main.c:14:19: error: 'num1' undeclared (first use in this function); did you mean 'num3'? 14 | printf("%d\n",num1 + num3); | ^~~~ | num3 main.c:14:19: note: each undeclared identifier is reported only once for each function it appears in
s535437002
p03844
C
#include<stdio.h> int main(void) { int num; char num2; int num3; int num4; scanf("%d",&num); scanf("%c",&num2); scanf("%d",&num3); if(num2 == '+'){ printf("%d\n",num1 + num3 = num4); } if(num2 == '-'){ printf("%d\n",num1 + num3 = num4); } return 0; }
main.c: In function 'main': main.c:15:19: error: 'num1' undeclared (first use in this function); did you mean 'num4'? 15 | printf("%d\n",num1 + num3 = num4); | ^~~~ | num4 main.c:15:19: note: each undeclared identifier is reported only once for each function it appears in
s535804256
p03844
C
#include<stdio.h> int main(void) { int num; char num2[10]; int num3; int num4; scanf("%d",&num); scanf("%c",&num2); scanf("%d",&num3); if(num2 == '+'){ printf("%d\n",num1 + num3 = num4); } if(num2 == '-'){ printf("%d\n",num1 + num3 = num4); return 0; }
main.c: In function 'main': main.c:14:11: warning: comparison between pointer and integer 14 | if(num2 == '+'){ | ^~ main.c:15:19: error: 'num1' undeclared (first use in this function); did you mean 'num4'? 15 | printf("%d\n",num1 + num3 = num4); | ^~~~ | num4 main.c:15:19: note: each undeclared identifier is reported only once for each function it appears in main.c:18:11: warning: comparison between pointer and integer 18 | if(num2 == '-'){ | ^~ main.c:22:1: error: expected declaration or statement at end of input 22 | } | ^
s556396159
p03844
C
#include<stdio.h> int main(void) { int num; char num2[10]; int num3; int num4; scanf("%d",&num); scanf("%c",&num2); scanf("%d",&num3); if(num2 == '+'){ printf("%d + %d = %d\n",num1,num3,num4); } if(num2 == '-'){ printf("%d - %d = %d\n",num1,num3,num4); return 0; }
main.c: In function 'main': main.c:14:11: warning: comparison between pointer and integer 14 | if(num2 == '+'){ | ^~ main.c:15:29: error: 'num1' undeclared (first use in this function); did you mean 'num4'? 15 | printf("%d + %d = %d\n",num1,num3,num4); | ^~~~ | num4 main.c:15:29: note: each undeclared identifier is reported only once for each function it appears in main.c:18:11: warning: comparison between pointer and integer 18 | if(num2 == '-'){ | ^~ main.c:22:1: error: expected declaration or statement at end of input 22 | } | ^
s566828474
p03844
C
#include<stdio.h> int main(void) { int num; char num2[10]; int num3; int num4; scanf("%d",&num); fgets(num2,10,stdin); scanf("%d",&num3); if(num2 == '+'){ printf("%d + %d = %d\n",num1,num3,num4); } if(num2 == '-'){ printf("%d - %d = %d\n",num1,num3,num4); return 0; }
main.c: In function 'main': main.c:14:11: warning: comparison between pointer and integer 14 | if(num2 == '+'){ | ^~ main.c:15:29: error: 'num1' undeclared (first use in this function); did you mean 'num4'? 15 | printf("%d + %d = %d\n",num1,num3,num4); | ^~~~ | num4 main.c:15:29: note: each undeclared identifier is reported only once for each function it appears in main.c:18:11: warning: comparison between pointer and integer 18 | if(num2 == '-'){ | ^~ main.c:22:1: error: expected declaration or statement at end of input 22 | } | ^
s701281075
p03844
C
#include<stdio.h> int main(void) { int num; char num2[10]; int num3; int num4; scanf("%d",&num); fgets(num2,10,stdin); scanf("%d",&num3); if(num2 == "+"){ printf("%d + %d = %d\n",num1,num3,num4); } if(num2 == "-"){ printf("%d - %d = %d\n",num1,num3,num4); return 0; }
main.c: In function 'main': main.c:15:29: error: 'num1' undeclared (first use in this function); did you mean 'num4'? 15 | printf("%d + %d = %d\n",num1,num3,num4); | ^~~~ | num4 main.c:15:29: note: each undeclared identifier is reported only once for each function it appears in main.c:22:1: error: expected declaration or statement at end of input 22 | } | ^
s974686791
p03844
C++
#include<bits/stdc++.h> using namespace std; int main(){ string a; int c,b; cin>>b>>a>>c; if(a=='-') cout<<b-c; else cout<<b+c; cout<<"\n"; }
a.cc: In function 'int main()': a.cc:7:9: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char') 7 | if(a=='-') cout<<b-c; | ~^~~~~ | | | | | 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:7:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 7 | if(a=='-') cout<<b-c; | ^~~ /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:7:11: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char' 7 | if(a=='-') cout<<b-c; | ^~~ /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:7:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 7 | if(a=='-') cout<<b-c; | ^~~ /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:7:11: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char' 7 | if(a=='-') cout<<b-c; | ^~~ /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:7:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 7 | if(a=='-') cout<<b-c; | ^~~ /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:7:11: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char' 7 | if(a=='-') cout<<b-c; | ^~~ /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:7:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 7 | if(a=='-') cout<<b-c; | ^~~ /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:7:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::match_results<_BiIter, _Alloc>' 7 | if(a=='-') cout<<b-c; | ^~~ 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:7:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>' 7 | if(a=='-') cout<<b-c; | ^~~ 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:7:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 7 | if(a=='-') cout<<b-c; | ^~~ /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:7:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 7 | if(a=='-') cout<<b-c; | ^~~ /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:7:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 7 | if(a=='-') cout<<b-c; | ^~~ /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:7:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 7 | if(a=='-') cout<<b-c; | ^~~ 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:7:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::fpos<_StateT>' 7 | if(a=='-') cout<<b-c; | ^~~ 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:7:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::allocator<_CharT>' 7 | if(a=='-') cout<<b-c; | ^~~ 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:7:11: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 7 | if(a=='-') cout<<b-c; |
s146961003
p03844
C++
using namespace std; int main(){ string a; int c,b; cin>>b>>a>>c; if(a=='-') cout<<b-c; else cout<<b+c; cout<<"\n"; }
a.cc: In function 'int main()': a.cc:3:1: error: 'string' was not declared in this scope 3 | string a; | ^~~~~~ a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>' +++ |+#include <string> 1 | using namespace std; a.cc:5:1: error: 'cin' was not declared in this scope 5 | cin>>b>>a>>c; | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | using namespace std; a.cc:5:9: error: 'a' was not declared in this scope 5 | cin>>b>>a>>c; | ^ a.cc:6:12: error: 'cout' was not declared in this scope 6 | if(a=='-') cout<<b-c; | ^~~~ a.cc:6:12: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:7:6: error: 'cout' was not declared in this scope 7 | else cout<<b+c; | ^~~~ a.cc:7:6: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:8:1: error: 'cout' was not declared in this scope 8 | cout<<"\n"; | ^~~~ a.cc:8:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
s218537173
p03844
C++
#include<bits/stdc++.h> using namespace std; int main(){ string a; itn c,b cin>>b>>a>>c; if(a=='-') cout<<b-c; else cout<<b+c; cout<<"\n"; }
a.cc: In function 'int main()': a.cc:5:3: error: 'itn' was not declared in this scope; did you mean 'int'? 5 | itn c,b | ^~~ | int a.cc:7:7: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char') 7 | if(a=='-') cout<<b-c; | ~^~~~~ | | | | | 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:7:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 7 | if(a=='-') cout<<b-c; | ^~~ /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:7:9: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char' 7 | if(a=='-') cout<<b-c; | ^~~ /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:7:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 7 | if(a=='-') cout<<b-c; | ^~~ /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:7:9: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char' 7 | if(a=='-') cout<<b-c; | ^~~ /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:7:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 7 | if(a=='-') cout<<b-c; | ^~~ /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:7:9: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char' 7 | if(a=='-') cout<<b-c; | ^~~ /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:7:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 7 | if(a=='-') cout<<b-c; | ^~~ /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:7:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::match_results<_BiIter, _Alloc>' 7 | if(a=='-') cout<<b-c; | ^~~ 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:7:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>' 7 | if(a=='-') cout<<b-c; | ^~~ 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:7:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 7 | if(a=='-') cout<<b-c; | ^~~ /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:7:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 7 | if(a=='-') cout<<b-c; | ^~~ /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:7:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 7 | if(a=='-') cout<<b-c; | ^~~ /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:7:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 7 | if(a=='-') cout<<b-c; | ^~~ 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:7:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::fpos<_StateT>' 7 | if(a=='-') cout<<b-c; | ^~~ 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:7:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::allocator<_CharT>' 7 | if(a=='-') cout<<b-c; | ^~~ 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:7:9: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 7 | if(a==
s263881515
p03844
C
a = input() left, op, right = a.split(" ") if op == '-': print(int(left) - int(right)) else: print(int(left) + int(right))
main.c:1:1: warning: data definition has no type or storage class 1 | a = input() | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int] main.c:1:5: error: implicit declaration of function 'input' [-Wimplicit-function-declaration] 1 | a = input() | ^~~~~ main.c:1:5: error: initializer element is not constant main.c:2:1: error: expected ',' or ';' before 'left' 2 | left, op, right = a.split(" ") | ^~~~
s378820359
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 if ( S == '-') { cout << A-B << endl; }else { cout << error << endl; } }
a.cc: In function 'int main()': a.cc:15:9: error: 'error' was not declared in this scope; did you mean 'perror'? 15 | cout << error << endl; | ^~~~~ | perror
s468727131
p03844
C
#include <iostream> using namespace std; int const MAX = 11; typedef int DataType; void Error(const string& s) { cout << s; } struct Stack { DataType data[MAX]; int top; int length; }; Stack a; Stack b; Stack r; char op; void InitStack(Stack *s) { s->top = -1; } bool StackEmpty(Stack *s) { return s->top == -1; } bool StackFull(Stack *s) { return s->top == MAX - 1; } void Push(Stack *s, int i) { if(StackFull(s)) { Error("Stack underflow"); return; } s->data[++s->top] = i; } int Sizeof(Stack *s) { return s->top + 1; } DataType Pop(Stack *s) { if(StackEmpty(s)) { return 0; } return s->data[s->top--]; } DataType StackTop(Stack *s) { if(StackEmpty(s)) { return 0; } return s->data[s->top]; } int char2int(char c) { return c-'0'; } void printStack(Stack* result) { bool start = false; while(!StackEmpty(result)) { if(StackTop(result) == 0) { if(start) { cout << Pop(result); } else { Pop(result); } } else { if(!start) { start = true; } cout << Pop(result); } } cout << endl; } void input() { Stack *p = &a; // input a, b int index = 0; char c; cin.get(c); while( c != '\n' ) { if( c == ' ') { cin.get(c); if(c == '+' || c == '-') { op = c; p = &b; } cin.get(c); } else { Push(p, char2int(c)); } cin.get(c); } } void compute(char & op, Stack* left, Stack* right, Stack* result) { int local_a, local_b, local_r, local_add = 0; if(op == '+') { op = NULL; for(int i=0; i<MAX; ++i) { if (StackEmpty(left)) { local_a = 0; } else { local_a = Pop(left); } if (StackEmpty(right)) { local_b = 0; } else { local_b = Pop(right); } local_r = (local_a + local_b + local_add) % 10; local_add = (local_a + local_b + local_add) / 10; Push(result, local_r); } } else if(op == '-') { op = NULL; if( Sizeof(left) < Sizeof(right) || Sizeof(left) == Sizeof(right) && StackTop(left) < StackTop(right) ) { op = '-'; // 19 - 110 or 31 - 52 for(int i=0; i<MAX; ++i) { local_a = Pop(right); local_b = Pop(left); if (local_a - local_add - local_b < 0) { local_a += 10; local_r = local_a - local_add - local_b; local_add = 1; } else { local_r = local_a - local_b - local_add; local_add = 0; } Push(result, local_r); } } else { for(int i=0; i<MAX; ++i) { local_a = Pop(left); local_b = Pop(right); if (local_a - local_add - local_b < 0) { local_a += 10; local_r = local_a - local_add - local_b; local_add = 1; } else { local_r = local_a - local_b - local_add; local_add = 0; } Push(result, local_r); } } } } int main() { InitStack(&a); InitStack(&b); InitStack(&r); input(); compute(op, &a, &b, &r); if(op) cout << op; printStack(&r); }
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s655115644
p03844
C
#include <stdio.h> #include <stdlib.h> #include <math.h> #include <string.h> #define ll long long #define rep(i,l,r) for(ll i=(l);i<(r);i++) #define max(p,q) ((p)>(q)?(p):(q)) #define min(p,q) ((p)<(q)?(p):(q)) #define chmax(a,b) ((a)=(a)>(b)?(a):(b)) #define chmin(a,b) ((a)=(a)<(b)?(a):(b)) #define abs(p) ((p)>=(0)?(p):(-(p))) int cmp(const void *a, const void *b); //your code here! int main(void){ char mm; ll A, B; scanf("%lld %c %lld", ); if(mm=='+')printf("%lld\n", A+B); else printf("%lld\n", A-B); return 0; } int cmp(const void *a, const void *b){ ll A=*(ll *)a, B=*(ll *)b; if(A==B)return 0; else return A>B ? 1:-1;//昇順ソート }
main.c: In function 'main': main.c:18:27: error: expected expression before ')' token 18 | scanf("%lld %c %lld", ); | ^
s310881029
p03844
C++
#include<bits/stdc++.h> using namespace std; int main(){ int a,c string op; cin>>a>>op>>c; if(op=="+"){ cout<<a+c<<endl; }else{ cout<<a-c<<endl; } }
a.cc: In function 'int main()': a.cc:5:5: error: expected initializer before 'string' 5 | string op; | ^~~~~~ a.cc:6:13: error: 'op' was not declared in this scope 6 | cin>>a>>op>>c; | ^~ a.cc:6:17: error: 'c' was not declared in this scope 6 | cin>>a>>op>>c; | ^
s041771810
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 if (op == "-"){ cout << A - B << endl; } }
a.cc: In function 'int main()': a.cc:7:7: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int') 7 | cin << A << op << B; | ~~~ ^~ ~ | | | | | int | std::istream {aka std::basic_istream<char>} a.cc:7:7: note: candidate: 'operator<<(int, int)' (built-in) 7 | cin << A << op << B; | ~~~~^~~~ a.cc:7:7: note: no known conversion for argument 1 from 'std::istream' {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:1715:5: note: candidate: 'template<class _Ch_type, class _Ch_traits, class _Bi_iter> std::basic_ostream<_CharT, _Traits>& std::__cxx11::operator<<(std::basic_ostream<_CharT, _Traits>&, const sub_match<_Bi_iter>&)' 1715 | operator<<(basic_ostream<_Ch_type, _Ch_traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1715:5: note: template argument deduction/substitution failed: a.cc:7:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 7 | cin << A << op << B; | ^ In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41: /usr/include/c++/14/cstddef:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)' 125 | operator<<(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed: a.cc:7:3: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte' 7 | cin << A << op << 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:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)' 763 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed: a.cc:7:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 7 | cin << A << op << B; | ^ /usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 4077 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed: a.cc:7:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 7 | cin << A << op << B; | ^ /usr/include/c++/14/bitset:1687:5: note: candidate: 'template<class _CharT, class _Traits, long unsigned int _Nb> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const bitset<_Nb>&)' 1687 | operator<<(std::basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bitset:1687:5: note: template argument deduction/substitution failed: a.cc:7:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 7 | cin << A << op << B; | ^ In file included from /usr/include/c++/14/bits/ios_base.h:46, from /usr/include/c++/14/streambuf:43, from /usr/include/c++/14/bits/streambuf_iterator.h:35, from /usr/include/c++/14/iterator:66, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:54: /usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)' 339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e) | ^~~~~~~~ /usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed: a.cc:7:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 7 | cin << A << op << B; | ^ In file included from /usr/include/c++/14/memory:80, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:56: /usr/include/c++/14/bits/shared_ptr.h:70:5: note: candidate: 'template<class _Ch, class _Tr, class _Tp, __gnu_cxx::_Lock_policy _Lp> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __shared_ptr<_Tp, _Lp>&)' 70 | operator<<(std::basic_ostream<_Ch, _Tr>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/shared_ptr.h:70:5: note: template argument deduction/substitution failed: a.cc:7:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 7 | cin << A << op << B; | ^ 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:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)' 563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c) | ^~~~~~~~ /usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed: a.cc:7:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 7 | cin << A << op << B; | ^ /usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)' 573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed: a.cc:7:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 7 | cin << A << op << B; | ^ /usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)' 579 | operator<<(basic_ostream<char, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed: a.cc:7:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 7 | cin << A << op << B; | ^ /usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)' 590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed: a.cc:7:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 7 | cin << A << op << B; | ^ /usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)' 595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed: a.cc:7:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 7 | cin << A << op << B; | ^ /usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)' 654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed: a.cc:7:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 7 | cin << A << op << B; | ^ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)' 307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed: a.cc:7:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 7 | cin << A << op << B; | ^ /usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)' 671 | operator<<(basic_ostream<char, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:671:5: note: template argument deduction/substitution failed: a.cc:7:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 7 | cin << A << op << B; | ^
s073857377
p03844
C++
#include <bts/stdc++.h> using namespace std; int main() { int A, B; string op; cin >> A >> op >> B; if (op == "+") { cout << A + B << endl; } else if (op == "-") { cout << A - B << endl; } }
a.cc:1:10: fatal error: bts/stdc++.h: No such file or directory 1 | #include <bts/stdc++.h> | ^~~~~~~~~~~~~~ compilation terminated.
s912006477
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 if(s == '-'){ 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(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:11: 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:11: 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:11: 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:11: 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:11: 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:11: 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:11: 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:11: 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:11: 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:11: 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:11: 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:11: 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:11: 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:11: 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:11: 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:11: 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:637:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator==(basic_string_view<_CharT, _Traits>, basic
s165832003
p03844
C++
#include <bits/stdc++.h> using namespace std; int main() { int A, B; string op; cin >> A >> op >> C; if (op == "+") cout << A + B << endl; else cout << A - B << endl; return 0; }
a.cc: In function 'int main()': a.cc:8:23: error: 'C' was not declared in this scope 8 | cin >> A >> op >> C; | ^
s999405178
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:6:3: error: expected initializer before 'string' 6 | string S; | ^~~~~~ a.cc:7:15: error: 'S' was not declared in this scope 7 | cin >> A >> S >> B; | ^ a.cc:7:20: error: 'B' was not declared in this scope 7 | cin >> A >> S >> B; | ^
s313889386
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.next(); if(op.equals("-"))System.out.println(a-b); else System.out.println(a+b); } }
Main.java:7: error: incompatible types: String cannot be converted to int int b = sc.next(); ^ 1 error
s815580206
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=='+'){ | ~~^~~~~ | | | | | 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=='+'){ | ^~~ /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=='+'){ | ^~~ /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=='+'){ | ^~~ /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=='+'){ | ^~~ /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=='+'){ | ^~~ /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=='+'){ | ^~~ /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=='+'){ | ^~~ /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=='+'){ | ^~~ 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=='+'){ | ^~~ 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=='+'){ | ^~~ /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=='+'){ | ^~~ /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=='+'){ | ^~~ /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=='+'){ | ^~~ 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=='+'){ | ^~~ 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=='+'){ | ^~~ 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 | 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>)' 63
s286128492
p03844
C++
#include <bits/stdc++.h> using namespace std; int main(){ int a,b; string op; cin >>a>>op>>c; if(op=='+'){ cout << a+b <<endl; } else{ cout << a-b<<endl; } }
a.cc: In function 'int main()': a.cc:7:16: error: 'c' was not declared in this scope 7 | cin >>a>>op>>c; | ^ 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=='+'){ | ~~^~~~~ | | | | | 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=='+'){ | ^~~ /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=='+'){ | ^~~ /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=='+'){ | ^~~ /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=='+'){ | ^~~ /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=='+'){ | ^~~ /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=='+'){ | ^~~ /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=='+'){ | ^~~ /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=='+'){ | ^~~ 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=='+'){ | ^~~ 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=='+'){ | ^~~ /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=='+'){ | ^~~ /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=='+'){ | ^~~ /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=='+'){ | ^~~ 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=='+'){ | ^~~ 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=='+'){ | ^~~ 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 | if(op=='+'){ | ^~~ /usr/include/c++/14/string_view:637:5: note: candidate: 'template<class _CharT, class _Traits> cons
s903086118
p03844
C++
/ A - Addition and Subtraction Easy #include <bits/stdc++.h> using namespace std; int main(){ int a,b; char o; cin>>a>>o>>b; cout<< (o=='+'? a+b: a-b) <<endl; }
a.cc:1:1: error: expected unqualified-id before '/' token 1 | / A - Addition and Subtraction Easy | ^ In file included from /usr/include/c++/14/bits/stl_algobase.h:62, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:2: /usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu_cxx::__is_null_pointer' redeclared as different kind of entity 164 | __is_null_pointer(std::nullptr_t) | ^ /usr/include/c++/14/ext/type_traits.h:159:5: note: previous declaration 'template<class _Type> constexpr bool __gnu_cxx::__is_null_pointer(_Type)' 159 | __is_null_pointer(_Type) | ^~~~~~~~~~~~~~~~~ /usr/include/c++/14/ext/type_traits.h:164:26: error: 'nullptr_t' is not a member of 'std'; did you mean 'nullptr_t'? 164 | __is_null_pointer(std::nullptr_t) | ^~~~~~~~~ In file included from /usr/include/c++/14/cstddef:50, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41: /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:443:29: note: 'nullptr_t' declared here 443 | typedef decltype(nullptr) nullptr_t; | ^~~~~~~~~ In file included from /usr/include/c++/14/bits/stl_pair.h:60, from /usr/include/c++/14/bits/stl_algobase.h:64: /usr/include/c++/14/type_traits:666:33: error: 'nullptr_t' is not a member of 'std'; did you mean 'nullptr_t'? 666 | struct is_null_pointer<std::nullptr_t> | ^~~~~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:443:29: note: 'nullptr_t' declared here 443 | typedef decltype(nullptr) nullptr_t; | ^~~~~~~~~ /usr/include/c++/14/type_traits:666:42: error: template argument 1 is invalid 666 | struct is_null_pointer<std::nullptr_t> | ^ /usr/include/c++/14/type_traits:670:48: error: template argument 1 is invalid 670 | struct is_null_pointer<const std::nullptr_t> | ^ /usr/include/c++/14/type_traits:674:51: error: template argument 1 is invalid 674 | struct is_null_pointer<volatile std::nullptr_t> | ^ /usr/include/c++/14/type_traits:678:57: error: template argument 1 is invalid 678 | struct is_null_pointer<const volatile std::nullptr_t> | ^ /usr/include/c++/14/type_traits:1429:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1429 | : public integral_constant<std::size_t, alignof(_Tp)> | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1429:57: error: template argument 1 is invalid 1429 | : public integral_constant<std::size_t, alignof(_Tp)> | ^ /usr/include/c++/14/type_traits:1429:57: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1438:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1438 | : public integral_constant<std::size_t, 0> { }; | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1438:46: error: template argument 1 is invalid 1438 | : public integral_constant<std::size_t, 0> { }; | ^ /usr/include/c++/14/type_traits:1438:46: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1440:26: error: 'std::size_t' has not been declared 1440 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:1441:21: error: '_Size' was not declared in this scope 1441 | struct rank<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:1441:27: error: template argument 1 is invalid 1441 | struct rank<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:1442:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1442:65: error: template argument 1 is invalid 1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^ /usr/include/c++/14/type_traits:1442:65: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1446:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1446:65: error: template argument 1 is invalid 1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^ /usr/include/c++/14/type_traits:1446:65: note: invalid template non-type parameter /usr/include/c++/14/type_traits:2086:26: error: 'std::size_t' has not been declared 2086 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:2087:30: error: '_Size' was not declared in this scope 2087 | struct remove_extent<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:2087:36: error: template argument 1 is invalid 2087 | struct remove_extent<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:2099:26: error: 'std::size_t' has not been declared 2099 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:2100:35: error: '_Size' was not declared in this scope 2100 | struct remove_all_extents<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:2100:41: error: template argument 1 is invalid 2100 | struct remove_all_extents<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:2171:12: error: 'std::size_t' has not been declared 2171 | template<std::size_t _Len> | ^~~ /usr/include/c++/14/type_traits:2176:30: error: '_Len' was not declared in this scope 2176 | unsigned char __data[_Len]; | ^~~~ /usr/include/c++/14/type_traits:2194:12: error: 'std::size_t' has not been declared 2194 | template<std::size_t _Len, std::size_t _Align = | ^~~ /usr/include/c++/14/type_traits:2194:30: error: 'std::size_t' has not been declared 2194 | template<std::size_t _Len, std::size_t _Align = | ^~~ /usr/include/c++/14/type_traits:2195:55: error: '_Len' was not declared in this scope 2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)> | ^~~~ /usr/include/c++/14/type_traits:2195:59: error: template argument 1 is invalid 2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)> | ^ /usr/include/c++/14/type_traits:2202:30: error: '_Len' was not declared in this scope 2202 | unsigned char __data[_Len]; | ^~~~ /usr/include/c++/14/type_traits:2203:44: error: '_Align' was not declared in this scope 2203 | struct __attribute__((__aligned__((_Align)))) { } __align; | ^~~~~~ In file included from /usr/include/c++/14/bits/stl_tempbuf.h:59, from /usr/include/c++/14/bits/stl_algo.h:69, from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/new:131:26: error: declaration of 'operator new' as non-function 131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~~~ /usr/include/c++/14/new:131:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:132:41: error: attributes after parenthesized initializer ignored [-fpermissive] 132 | __attribute__((__externally_visible__)); | ^ /usr/include/c++/14/new:133:26: error: declaration of 'operator new []' as non-function 133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~~~ /usr/include/c++/14/new:133:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:134:41: error: attributes after parenthesized initializer ignored [-fpermissive] 134 | __attribute__((__externally_visible__)); |
s395113957
p03844
C++
#include <bits/stdc++.h> using namespace std; int main() { int A, B, ans; char C; cin >> A >> C >> B; if (C == '+') { ans = A + B } else { ans = A - B } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:11:16: error: expected ';' before '}' token 11 | ans = A + B | ^ | ; 12 | } | ~ a.cc:15:16: error: expected ';' before '}' token 15 | ans = A - B | ^ | ; 16 | } | ~
s108036972
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=='+'){ | ~~^~~~~ | | | | | 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=='+'){ | ^~~ /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=='+'){ | ^~~ /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=='+'){ | ^~~ /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=='+'){ | ^~~ /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=='+'){ | ^~~ /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=='+'){ | ^~~ /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=='+'){ | ^~~ /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=='+'){ | ^~~ 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=='+'){ | ^~~ 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=='+'){ | ^~~ /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=='+'){ | ^~~ /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=='+'){ | ^~~ /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=='+'){ | ^~~ 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=='+'){ | ^~~ 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=='+'){ | ^~~ 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 | 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>)' 63
s189097960
p03844
C++
#include <iostream> using namespace std; int main() { int a, b; string s; cin >> a >> s >> b; if(s == '+'){ cout << a + b << endl; } if(s == '-'){ cout << a - b << endl; } }
a.cc: In function 'int main()': a.cc:8:14: 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/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:8:17: 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, 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:8:17: 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/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:8:17: 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:17: 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:17: 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:17: 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/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:8:17: 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/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:17: 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: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:8:17: 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: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:8:17: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'char' 8 | if(s == '+'){ | ^~~ /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:8:17: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'char' 8 | if(s == '+'){ | ^~~ /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:8:17: note: mismatched types 'const _CharT*' and 'char' 8 | if(s == '+'){ | ^~~ /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:8:17: note: mismatched types 'const _CharT*' and 'std::__cxx11::basic_string<char>' 8 | if(s == '+'){ | ^~~ 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:8:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::tuple<_UTypes ...>' 8 | if(s == '+'){ | ^~~ 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:8:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::istreambuf_iterator<_CharT, _Traits>' 8 | if(s == '+'){ | ^~~ 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 |
s775580500
p03844
C++
#include <bits/stdc++.h> using namespace std; int main() { int A,B,ans; char op; cin >> A >> op >> Bl; if(op == '+') { ans = A + B; } else if(op == '-') { ans = A - B; } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:7:21: error: 'Bl' was not declared in this scope; did you mean 'B'? 7 | cin >> A >> op >> Bl; | ^~ | B
s898969733
p03844
C++
import java.util.* fun main() { val scanner = Scanner(System.`in`) val n = scanner.nextInt() val list = mutableListOf<Int>() for (i in 0..n) { val a = scanner.nextInt() list.add(i, a) } val m = scanner.nextInt() for (i in 0 until m){ val drink = scanner.nextInt() list[i] = scanner.nextInt() System.out.print(list.sum()) } }
a.cc:4:34: error: stray '`' in program 4 | val scanner = Scanner(System.`in`) | ^ a.cc:4:37: error: stray '`' in program 4 | val scanner = Scanner(System.`in`) | ^ a.cc:7:15: error: too many decimal points in number 7 | for (i in 0..n) { | ^~~~ a.cc:1:1: error: 'import' does not name a type 1 | import java.util.* | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
s713225601
p03844
C++
#include <bits/stdc++.h> using namespace std; int main(){ int A, B, ans; string op; cin >> A >> op >> B; if(op == '+') ans = A + B; else ans = A - B; cout << ans << 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 | if(op == '+') ans = A + B; | ~~ ^~ ~~~ | | | | | 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 | if(op == '+') ans = A + B; | ^~~ /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 | if(op == '+') ans = A + B; | ^~~ /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 | if(op == '+') ans = A + B; | ^~~ /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 | if(op == '+') ans = A + B; | ^~~ /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 | if(op == '+') ans = A + B; | ^~~ /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 | if(op == '+') ans = A + B; | ^~~ /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 | if(op == '+') ans = A + B; | ^~~ /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 | if(op == '+') ans = A + 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: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 | if(op == '+') ans = A + B; | ^~~ 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 | if(op == '+') ans = A + B; | ^~~ /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 | if(op == '+') ans = A + B; | ^~~ /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 | if(op == '+') ans = A + B; | ^~~ /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 | if(op == '+') ans = A + B; | ^~~ 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 | if(op == '+') ans = A + B; | ^~~ 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 | if(op == '+') ans = A + B; | ^~~ 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, |
s244515193
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; } }
a.cc: In function 'int main()': a.cc:8:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 8 | if (op == "+") { | ~~~^~~~~~
s965453589
p03844
C++
#include <bits/stdc++.h> using namespace std; int main() { int a, b; char op; cin >> a >> op >> c; if (op == "+") { cout << a + b << endl; } else { cout << a - b << endl; } }
a.cc: In function 'int main()': a.cc:7:21: error: 'c' was not declared in this scope 7 | cin >> a >> op >> c; | ^ a.cc:8:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 8 | if (op == "+") { | ~~~^~~~~~
s320623328
p03844
Java
import lesson.topcoder.FriendsScore; 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(); int ans = 0; if (op.equals("+")) { ans = a + b; } else { ans = a - b; } System.out.println(ans); } }
Main.java:1: error: package lesson.topcoder does not exist import lesson.topcoder.FriendsScore; ^ 1 error
s853885886
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; else if(c=='*') cout<<a*b<<endl; else if(c=='/'){ if(b==0) cout<<"Divided by zero!"<<endl; else cout<<a/b<<endl; } else cout<<"Invalid operator!"<<endl; return 0; }
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory 1 | #include<bits/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s548631216
p03844
C++
#include <iostream> #include <string> using namespace std; class Cal { public: Cal(int num1, int num2, int num3) { CaNum1 = num1; CaM = num2; CaNum2 = num3; } void Result(); private: int add() { return CaNum1 + CaNum2; }; int sub() { return CaNum1 - CaNum2; }; int CaNum1, CaNum2, CaM; }; void Cal::Result() { switch (CaM) { case '+': printf("%d", add()); break; case '-': printf("%d", sub()); break; default: break; } return; } int takeNum(int num) { switch (num) { case '0': return 0; case '1': return 1; case '2': return 2; case '3': return 3; case '4': return 4; case '5': return 5; case '6': return 6; case '7': return 7; case '8': return 8; case '9': return 9; default: return 0; break; } return 0; } int main(void) { string s; int i = 0; bool boo = false; int buf[3] = { 0,'+',0 }; int p = 0; int mar = 1; getline(cin, s); char* str = new char[s.length() + 1]; strcpy(str, s.c_str()); while (s[i] != '\0') { if ('0' <= str[i] && str[i] <= '9') { buf[p] = (buf[p] * 10) + takeNum(str[i]); } else if ('-' == str[i] || '+' == str[i]) { p++; buf[p] = (int)str[i]; p++; } i++; } Cal myCal1{buf[0], buf[1], buf[2]}; myCal1.Result(); return 0; }
a.cc: In function 'int main()': a.cc:76:9: error: 'strcpy' was not declared in this scope 76 | strcpy(str, s.c_str()); | ^~~~~~ a.cc:2:1: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <iostream> +++ |+#include <cstring> 2 | #include <string>
s363392830
p03844
C++
#include <bits/stdc++.h> using namespace std; int main() { long x,y,z,a; cin >> x >> y >> z; if (y == "+") { a = x+z; cout << a << endl; } else if (y == "-") { a = x-z; cout << a << endl; } }
a.cc: In function 'int main()': a.cc:6:9: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 6 | if (y == "+") { | ~~^~~~~~ a.cc:9:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 9 | } else if (y == "-") { | ~~^~~~~~
s985392452
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; }
a.cc: In function 'int main()': a.cc:7:7: error: expected ';' before 'A' 7 | cin A >> op >> B; | ^~ | ;
s655289061
p03844
C++
#include<bits/std c++.h> using namespace std. long long a,b; char s; int main(){ scanf("%lld %c %lld",&a,&s,&b); if(s=='+'){ printf("%lld\n",a+b);} else{ printf("%lld\n" ,a-b);} return 0;}
a.cc:1:9: fatal error: bits/std c++.h: No such file or directory 1 | #include<bits/std c++.h> | ^~~~~~~~~~~~~~~~ compilation terminated.
s909273721
p03844
C++
include<bits/stdc++.h> using namespace std; long long a,b; char s; int main() { scanf("%lld %c %lld",&a,&s,&b); if(s=='+') { printf("%lld\n",a+b); } else { printf("%lld\n",a-b); } return 0; }
a.cc:1:1: error: 'include' does not name a type 1 | include<bits/stdc++.h> | ^~~~~~~ a.cc: In function 'int main()': a.cc:7:5: error: 'scanf' was not declared in this scope 7 | scanf("%lld %c %lld",&a,&s,&b); | ^~~~~ a.cc:10:9: error: 'printf' was not declared in this scope 10 | printf("%lld\n",a+b); | ^~~~~~ a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' +++ |+#include <cstdio> 1 | include<bits/stdc++.h> a.cc:14:10: error: 'printf' was not declared in this scope 14 | printf("%lld\n",a-b); | ^~~~~~ a.cc:14:10: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
s011572575
p03844
C++
#include<bits/stdc++.h> using namespace std; int main(){ char op; int a,b 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: expected initializer before 'cin' 6 | cin>>a>>op>>b; | ^~~ a.cc:8:13: error: 'b' was not declared in this scope 8 | cout << a+b <<endl; | ^ a.cc:9:18: error: 'b' was not declared in this scope 9 | else cout << a-b <<endl; | ^
s368589684
p03844
C++
#include <iostream> using namespace std; int main(){ int a,b; char c ='z'; cin>>a,c,b; if('z'=='+'){ cout<<a+b; else cout<<a-b; } }
a.cc: In function 'int main()': a.cc:9:1: error: expected '}' before 'else' 9 | else | ^~~~ a.cc:7:13: note: to match this '{' 7 | if('z'=='+'){ | ^ a.cc: At global scope: a.cc:12:1: error: expected declaration before '}' token 12 | } | ^
s778349338
p03844
C++
#include <iostream> using namespace std; int main(){ int a,b; char c ='z'; cin>>a,b,c; if('z'=='+'){ cout<<a+b; else cout<<a-b; } }
a.cc: In function 'int main()': a.cc:9:1: error: expected '}' before 'else' 9 | else | ^~~~ a.cc:7:13: note: to match this '{' 7 | if('z'=='+'){ | ^ a.cc: At global scope: a.cc:12:1: error: expected declaration before '}' token 12 | } | ^
s459495443
p03844
C++
#include <iostream> using namespace std; int main(){ int a,b; char c ='z'; cin>>a,b,c; if(c=='+') cout<<a+b else cout<<a-b; }
a.cc: In function 'int main()': a.cc:8:10: error: expected ';' before 'else' 8 | cout<<a+b | ^ | ; 9 | else | ~~~~
s003528327
p03844
C++
#include <iostream> using namespace std; int main(){ int a,b; char ; cin>>a,b,c; if(c=='+'){ cout<<a+b else cout<<a-b; } }
a.cc: In function 'int main()': a.cc:5:1: error: declaration does not declare anything [-fpermissive] 5 | char ; | ^~~~ a.cc:6:10: error: 'c' was not declared in this scope 6 | cin>>a,b,c; | ^ a.cc:8:10: error: expected ';' before 'else' 8 | cout<<a+b | ^ | ; 9 | else | ~~~~
s339557560
p03844
C++
#include <iostream> using namespace std; int main(){ int a,b; char c =''; cin>>a,b,c; if(c=='+'){ cout<<a+b else cout<<a-b; } }
a.cc:5:9: error: empty character constant 5 | char c =''; | ^~ a.cc: In function 'int main()': a.cc:8:10: error: expected ';' before 'else' 8 | cout<<a+b | ^ | ; 9 | else | ~~~~
s960672793
p03844
C++
#include <iostream> using namespace std; int main(){ int a,b; char c ; cin>>a,b,c; switch (c):{ case '+': cout<<a+b; break; case '-': cout<<a-b; break; default; } }
a.cc: In function 'int main()': a.cc:7:11: error: expected primary-expression before ':' token 7 | switch (c):{ | ^
s354925745
p03844
C++
#include <iostream> using namespace std; int main(){ int a,b; char c =''; cin>>a,b,c; switch (c):{ case '+': cout<<a+b; break; case '-': cout<<a-b; break; default; } }
a.cc:5:9: error: empty character constant 5 | char c =''; | ^~ a.cc: In function 'int main()': a.cc:7:11: error: expected primary-expression before ':' token 7 | switch (c):{ | ^
s048627220
p03844
C++
#include<bits/stdc++.h> #define rep(i, n) for(int i = 0; i < n; i++) using namespace std; typedef long long ll; using Graph =vector<int>; typedef pair<ll,int> P; const ll MAX_N=131072; int bit[MAX_N*2-1]; ll n; int main(){ string s; ll A,B; cin >>A>>s>>B; if(s=='+') cout <<A+B<<endl; else cout <<A-B<<endl; }
a.cc: In function 'int main()': a.cc:16:7: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char') 16 | if(s=='+') 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:16:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 16 | if(s=='+') 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:16:9: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char' 16 | if(s=='+') 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:16:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 16 | if(s=='+') 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:16:9: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char' 16 | if(s=='+') 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:16:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 16 | if(s=='+') 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:16:9: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char' 16 | if(s=='+') 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:16:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 16 | if(s=='+') 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:16:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::match_results<_BiIter, _Alloc>' 16 | if(s=='+') 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:16:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>' 16 | if(s=='+') 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:16:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 16 | if(s=='+') 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:16:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 16 | if(s=='+') 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:16:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 16 | if(s=='+') 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:16:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 16 | if(s=='+') 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:16:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::fpos<_StateT>' 16 | if(s=='+') 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:16:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::allocator<_CharT>' 16 | if(s=='+') 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:16:9: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 16 |
s547708888
p03844
C++
#include<bits/stdc++.h> #define rep(i, n) for(int i = 0; i < n; i++) using namespace std; typedef long long ll; using Graph =vector<int>; typedef pair<ll,int> P; const ll MAX_N=131072; int bit[MAX_N*2-1]; ll n; int main(){ string s; ll A,B; cin >>A>>s>>B; if(s=='+') cout <<A+B<<endl; else cout <<A-B<<endl; }
a.cc: In function 'int main()': a.cc:16:7: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char') 16 | if(s=='+') 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:16:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 16 | if(s=='+') 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:16:9: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char' 16 | if(s=='+') 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:16:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 16 | if(s=='+') 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:16:9: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char' 16 | if(s=='+') 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:16:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 16 | if(s=='+') 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:16:9: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char' 16 | if(s=='+') 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:16:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 16 | if(s=='+') 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:16:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::match_results<_BiIter, _Alloc>' 16 | if(s=='+') 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:16:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>' 16 | if(s=='+') 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:16:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 16 | if(s=='+') 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:16:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 16 | if(s=='+') 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:16:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 16 | if(s=='+') 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:16:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 16 | if(s=='+') 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:16:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::fpos<_StateT>' 16 | if(s=='+') 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:16:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::allocator<_CharT>' 16 | if(s=='+') 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:16:9: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 16 |
s208481246
p03844
C++
#include <iostream> using namespace std; int main() { long long a,b; char o; cin>>a>>o>>b; if(1<=a && b<=10^9){ if(o=='+'){ z=a+b; printf("%d",z);} else{ if(o=='-') z=a-b; printf("%d",z);} } //return 0; }
a.cc: In function 'int main()': a.cc:10:17: error: 'z' was not declared in this scope 10 | z=a+b; | ^ a.cc:14:17: error: 'z' was not declared in this scope 14 | z=a-b; | ^ a.cc:15:29: error: 'z' was not declared in this scope 15 | printf("%d",z);} | ^
s989109149
p03844
C++
#include <iostream> using namespace std; int main() { long long a,b; char o; cin>>a>>o>>b; if(1<=a && b<=10^9){ if(o=='+') z=a+b; printf("%d",z); else if(o=='-') z=a-b; printf("%d",z); } return 0; }
a.cc: In function 'int main()': a.cc:10:17: error: 'z' was not declared in this scope 10 | z=a+b; | ^ a.cc:11:29: error: 'z' was not declared in this scope 11 | printf("%d",z); | ^ a.cc:12:17: error: expected '}' before 'else' 12 | else | ^~~~ a.cc:8:28: note: to match this '{' 8 | if(1<=a && b<=10^9){ | ^ a.cc:14:17: error: 'z' was not declared in this scope 14 | z=a-b; | ^ a.cc:15:29: error: 'z' was not declared in this scope 15 | printf("%d",z); | ^ a.cc: At global scope: a.cc:17:9: error: expected unqualified-id before 'return' 17 | return 0; | ^~~~~~ a.cc:18:1: error: expected declaration before '}' token 18 | } | ^
s753109541
p03844
C++
#include<bits/stdc++.h> using namespace std; int main(){ long long a,b; char op; cin>>a>>op>>b; if(op='+'){ cout<<a+b; else cout<<a-b; return 0; }
a.cc: In function 'int main()': a.cc:14:9: error: expected '}' before 'else' 14 | else | ^~~~ a.cc:10:19: note: to match this '{' 10 | if(op='+'){ | ^
s084937392
p03844
Java
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.equals("+")) { System.out.println(a + b); } else { System.out.println(a - b); } } }
Main.java:3: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:3: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors