submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3 values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s358904682 | p03844 | C++ | #include <iostream>
#include <string>
using namespace std;
int main() {
int A, B;
string op;
cin >> A >> op >> B;
if (op == '+') { cout << A+B; }
else { cout << A-B; }
return 0;
} | a.cc: In function 'int main()':
a.cc:10:10: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
10 | if (op == '+') { 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:10:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::fpos<_StateT>'
10 | if (op == '+') { 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:10:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::allocator<_CharT>'
10 | if (op == '+') { 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:10:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
10 | if (op == '+') { 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:10:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
10 | if (op == '+') { 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:10:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
10 | if (op == '+') { 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:10:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
10 | if (op == '+') { 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:10:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>'
10 | if (op == '+') { 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:10:13: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
10 | if (op == '+') { 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:10:13: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
10 | if (op == '+') { 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:10:13: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'char'
10 | if (op == '+') { 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:10:13: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'char'
10 | if (op == '+') { 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:10:13: note: mismatched types 'const _CharT*' and 'char'
10 | if (op == '+') { 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:10:13: note: mismatched types 'const _CharT*' and 'std::__cxx11::basic_string<char>'
10 | if (op == '+') { 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:10:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::tuple<_UTypes ...>'
10 | if (op == '+') { 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:10:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::istreambuf_iterator<_CharT, _Traits>'
10 | if (op == '+') { 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:21 |
s945655102 | p03844 | C++ | #include<iostream>
using namespace std;
int main(){
int a,b;
char op;
cin >> a >> op >> b;
cout << (c=='+'? a+b:a-b) << endl;
} | a.cc: In function 'int main()':
a.cc:7:12: error: 'c' was not declared in this scope
7 | cout << (c=='+'? a+b:a-b) << endl;
| ^
|
s291922950 | p03844 | C | #include<bits/stdc++.h>
int main()
{
int a,b;
scanf("%d&d",&a,&b)
if(a>=1 b<=10)printf("%d",a+b)
else printf("no")
} | main.c:1:9: fatal error: bits/stdc++.h: No such file or directory
1 | #include<bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s070618781 | 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 cout >>A-B>>endl;
}
| a.cc: In function 'int main()':
a.cc:8:18: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int')
8 | if(c=='+')cout >>A+B>>endl;
| ~~~~ ^~~~~
| | |
| | int
| std::ostream {aka std::basic_ostream<char>}
a.cc:8:18: note: candidate: 'operator>>(int, int)' (built-in)
8 | if(c=='+')cout >>A+B>>endl;
| ~~~~~^~~~~
a.cc:8:18: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'int'
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41,
from a.cc:1:
/usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)'
131 | operator>>(byte __b, _IntegerType __shift) noexcept
| ^~~~~~~~
/usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed:
a.cc:8:13: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte'
8 | if(c=='+')cout >>A+B>>endl;
| ^~~~
In file included from /usr/include/c++/14/string:55,
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/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
835 | operator>>(basic_istream<_CharT, _Traits>& __in,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed:
a.cc:8:22: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
8 | if(c=='+')cout >>A+B>>endl;
| ^
/usr/include/c++/14/bitset:1597:5: note: candidate: 'template<class _CharT, class _Traits, long unsigned int _Nb> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, bitset<_Nb>&)'
1597 | operator>>(std::basic_istream<_CharT, _Traits>& __is, bitset<_Nb>& __x)
| ^~~~~~~~
/usr/include/c++/14/bitset:1597:5: note: template argument deduction/substitution failed:
a.cc:8:22: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
8 | if(c=='+')cout >>A+B>>endl;
| ^
In file included from /usr/include/c++/14/istream:1109,
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/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)'
978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c)
| ^~~~~~~~
/usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed:
a.cc:8:22: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
8 | if(c=='+')cout >>A+B>>endl;
| ^
/usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)'
849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c)
| ^~~~~~~~
/usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed:
a.cc:8:22: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
8 | if(c=='+')cout >>A+B>>endl;
| ^
/usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)'
854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c)
| ^~~~~~~~
/usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed:
a.cc:8:22: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
8 | if(c=='+')cout >>A+B>>endl;
| ^
/usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)'
896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed:
a.cc:8:22: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
8 | if(c=='+')cout >>A+B>>endl;
| ^
/usr/include/c++/14/istream:939:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char*)'
939 | operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:939:5: note: template argument deduction/substitution failed:
a.cc:8:22: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
8 | if(c=='+')cout >>A+B>>endl;
| ^
/usr/include/c++/14/istream:945:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char*)'
945 | operator>>(basic_istream<char, _Traits>& __in, signed char* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:945:5: note: template argument deduction/substitution failed:
a.cc:8:22: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
8 | if(c=='+')cout >>A+B>>endl;
| ^
/usr/include/c++/14/istream:1099:5: note: candidate: 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&)'
1099 | operator>>(_Istream&& __is, _Tp&& __x)
| ^~~~~~~~
/usr/include/c++/14/istream:1099:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/istream: In substitution of 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&) [with _Istream = std::basic_ostream<char>&; _Tp = int]':
a.cc:8:22: required from here
8 | if(c=='+')cout >>A+B>>endl;
| ^
/usr/include/c++/14/istream:1099:5: error: no type named 'type' in 'struct std::enable_if<false, void>'
1099 | operator>>(_Istream&& __is, _Tp&& __x)
| ^~~~~~~~
/usr/include/c++/14/complex:509:5: note: candidate: 'template<class _Tp, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, complex<_Tp>&)'
509 | operator>>(basic_istream<_CharT, _Traits>& __is, complex<_Tp>& __x)
| ^~~~~~~~
/usr/include/c++/14/complex:509:5: note: template argument deduction/substitution failed:
a.cc:8:22: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
8 | if(c=='+')cout >>A+B>>endl;
| ^
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:143:
/usr/include/c++/14/iomanip:76:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Resetiosflags)'
76 | operator>>(basic_istream<_CharT, _Traits>& __is, _Resetiosflags __f)
| ^~~~~~~~
/usr/include/c++/14/iomanip:76:5: note: template argument deduction/substitution failed:
a.cc:8:22: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
8 | if(c=='+')cout >>A+B>>endl;
| ^
/usr/include/c++/14/iomanip:106:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setiosflags)'
106 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setiosflags __f)
| ^~~~~~~~
/usr/include/c++/14/iomanip:106:5: note: template argument deduction/substitution failed:
a.cc:8:22: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
8 | if(c=='+')cout >>A+B>>endl;
| ^
/usr/include/c++/14/iomanip:137:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setbase)'
137 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setbase __f)
| ^~~~~~~~
/usr/include/c++/14/iomanip:137:5: note: template argument deduction/substitution failed:
a.cc:8:22: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
8 | if(c=='+')cout >>A+B>>endl;
| ^
/usr/include/c++/14/iomanip:177:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setfill<_CharT>)'
177 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setfill<_CharT> __f)
| ^~~~~~~~
/usr/include/c++/14/iomanip:177:5: note: template argument deduction/substitution failed:
a.cc:8:22: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
8 | if(c=='+')cout >>A+B>>endl;
| ^
/usr/include/c++/14/iomanip:207:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istr |
s996550666 | p03844 | C++ | #include <iostreme>
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;
}
else
{
cout << "Error" << endl;
}
return 0;
} | a.cc:1:10: fatal error: iostreme: No such file or directory
1 | #include <iostreme>
| ^~~~~~~~~~
compilation terminated.
|
s130685331 | p03844 | C++ | #include <iostream>
#include <vector>
#include <cstdio>
#include <string>
#include <algorithm>
using namespace std;
int main()
{
int a, b;
char op;
cin >> a >> op >> b;
if (op == '+') {
// printf("%d\n", a+b);
cout << a+b << "\n";
}else {
cout << a-b << "\n";
//printf("%d\n", a-b);
}
return 0;
}
#include <iostream>
#include <vector>
#include <cstdio>
#include <string>
#include <algorithm>
using namespace std;
int main()
{
int a, b;
char op;
cin >> a >> op >> b;
if (op == '+') {
// printf("%d\n", a+b);
cout << a+b << "\n";
}else {
cout << a-b << "\n";
//printf("%d\n", a-b);
}
return 0;
}
| a.cc:29:5: error: redefinition of 'int main()'
29 | int main()
| ^~~~
a.cc:8:5: note: 'int main()' previously defined here
8 | int main()
| ^~~~
|
s831568135 | p03844 | C++ | #include<bits/stdc++.h>
#include<string>
using namespace std;
int a, b;
string op;
int main(){
cin >> a >> op >> b;
if(op == '+') cout << a + b << endl;
else cout << a - b << endl;
} | a.cc: In function 'int main()':
a.cc:8:9: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
8 | if(op == '+') cout << a + b << endl;
| ~~ ^~ ~~~
| | |
| | char
| std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/regex:68,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181,
from a.cc:1:
/usr/include/c++/14/bits/regex.h:1103:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const sub_match<_BiIter>&)'
1103 | operator==(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1103:5: note: template argument deduction/substitution failed:
a.cc:8:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
8 | if(op == '+') cout << a + b << endl;
| ^~~
/usr/include/c++/14/bits/regex.h:1199:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator==(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)'
1199 | operator==(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1199:5: note: template argument deduction/substitution failed:
a.cc:8:12: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char'
8 | if(op == '+') cout << a + b << endl;
| ^~~
/usr/include/c++/14/bits/regex.h:1274:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator==(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)'
1274 | operator==(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1274:5: note: template argument deduction/substitution failed:
a.cc:8:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
8 | if(op == '+') cout << a + b << endl;
| ^~~
/usr/include/c++/14/bits/regex.h:1366:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)'
1366 | operator==(typename iterator_traits<_Bi_iter>::value_type const* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1366:5: note: template argument deduction/substitution failed:
a.cc:8:12: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char'
8 | if(op == '+') cout << a + b << endl;
| ^~~
/usr/include/c++/14/bits/regex.h:1441:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)'
1441 | operator==(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1441:5: note: template argument deduction/substitution failed:
a.cc:8:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
8 | if(op == '+') cout << a + b << endl;
| ^~~
/usr/include/c++/14/bits/regex.h:1534:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)'
1534 | operator==(typename iterator_traits<_Bi_iter>::value_type const& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1534:5: note: template argument deduction/substitution failed:
a.cc:8:12: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char'
8 | if(op == '+') cout << a + b << endl;
| ^~~
/usr/include/c++/14/bits/regex.h:1613:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)'
1613 | operator==(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1613:5: note: template argument deduction/substitution failed:
a.cc:8:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
8 | if(op == '+') cout << a + b << endl;
| ^~~
/usr/include/c++/14/bits/regex.h:2186:5: note: candidate: 'template<class _Bi_iter, class _Alloc> bool std::__cxx11::operator==(const match_results<_BiIter, _Alloc>&, const match_results<_BiIter, _Alloc>&)'
2186 | operator==(const match_results<_Bi_iter, _Alloc>& __m1,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:2186:5: note: template argument deduction/substitution failed:
a.cc:8:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::match_results<_BiIter, _Alloc>'
8 | if(op == '+') cout << a + b << endl;
| ^~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/bits/stl_pair.h:1033:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator==(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1033 | operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1033:5: note: template argument deduction/substitution failed:
a.cc:8:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>'
8 | if(op == '+') cout << a + b << endl;
| ^~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:67:
/usr/include/c++/14/bits/stl_iterator.h:441:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
441 | operator==(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:441:5: note: template argument deduction/substitution failed:
a.cc:8:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
8 | if(op == '+') cout << a + b << endl;
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:486:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
486 | operator==(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:486:5: note: template argument deduction/substitution failed:
a.cc:8:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
8 | if(op == '+') cout << a + b << endl;
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:1667:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1667 | operator==(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1667:5: note: template argument deduction/substitution failed:
a.cc:8:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
8 | if(op == '+') cout << a + b << endl;
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:1737:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1737 | operator==(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1737:5: note: template argument deduction/substitution failed:
a.cc:8:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
8 | if(op == '+') cout << a + b << endl;
| ^~~
In file included from /usr/include/c++/14/bits/char_traits.h:42,
from /usr/include/c++/14/string:42,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/bits/postypes.h:192:5: note: candidate: 'template<class _StateT> bool std::operator==(const fpos<_StateT>&, const fpos<_StateT>&)'
192 | operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/postypes.h:192:5: note: template argument deduction/substitution failed:
a.cc:8:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::fpos<_StateT>'
8 | if(op == '+') cout << a + b << endl;
| ^~~
In file included from /usr/include/c++/14/string:43:
/usr/include/c++/14/bits/allocator.h:235:5: note: candidate: 'template<class _T1, class _T2> bool std::operator==(const allocator<_CharT>&, const allocator<_T2>&)'
235 | operator==(const allocator<_T1>&, const allocator<_T2>&)
| ^~~~~~~~
/usr/include/c++/14/bits/allocator.h:235:5: note: template argument deduction/substitution failed:
a.cc:8:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::allocator<_CharT>'
8 | if(op == '+') cout << a + b << endl;
| ^~~
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54:
/usr/include/c++/14/string_view:629:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator==(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)'
629 | operator==(basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:629:5: |
s672777131 | p03844 | C++ | #include<cstdio>
int main(){
int A, B;
char op;
scanf("%d %c %d", &A,&op,&B);
if(op == '+') printf("%d\n", A+B);
if(op == '-') printf("%d\", A-B);
return 0;
} | a.cc:8:30: warning: missing terminating " character
8 | if(op == '-') printf("%d\", A-B);
| ^
a.cc:8:30: error: missing terminating " character
8 | if(op == '-') printf("%d\", A-B);
| ^~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:10:9: error: expected primary-expression before 'return'
10 | return 0;
| ^~~~~~
|
s636518949 | p03844 | C | #include<studio.h>
using namespace std;
map<int,int>q;
long long h,m;
char s;
int main()
{
scanf("%lld %c %lld",&h,&s,&m);
if(s=='+')
{
printf("%lld\n",h+m);
}
else
{
printf("%lld\n",h-m);
}
return 0;
} | main.c:1:9: fatal error: studio.h: No such file or directory
1 | #include<studio.h>
| ^~~~~~~~~~
compilation terminated.
|
s063201583 | p03844 | C++ | #include<stdio.h>
int main()
{
int A,B;
char op;
scanf("%d%c%d",&A,&op,&B);
printf("%d\n",A op B);
return 0;
} | a.cc: In function 'int main()':
a.cc:7:24: error: expected ')' before 'op'
7 | printf("%d\n",A op B);
| ~ ^~~
| )
|
s355666544 | p03844 | C++ | #include<stdio.h>
int main(){
int a,b;
char op;
scanf("%d%d",a,b);
printf("%d\n",a op b);
return 0;
} | a.cc: In function 'int main()':
a.cc:6:24: error: expected ')' before 'op'
6 | printf("%d\n",a op b);
| ~ ^~~
| )
|
s496354649 | p03844 | C++ | #include<stdio.h>
int main(){
int a,b;
char op;
scanf("%d%%d",a,b);
printf("%d\n",a op b);
return 0;
} | a.cc: In function 'int main()':
a.cc:6:24: error: expected ')' before 'op'
6 | printf("%d\n",a op b);
| ~ ^~~
| )
|
s468034115 | p03844 | C++ | #include<stdio.h>
int main(){
int a,b,op;
scanf("%d%%d",a,b);
printf("%d\n",a op b);
return 0;
} | a.cc: In function 'int main()':
a.cc:5:24: error: expected ')' before 'op'
5 | printf("%d\n",a op b);
| ~ ^~~
| )
|
s578863296 | p03844 | Java | import java.util.Scanner;
public class findSecond
{
public static void main(String[] args)
{
int A;
int B;
int C;
Scanner N = new Scanner(System.in);
A = N.nextInt();
B = N.nextInt();
C = A+B;
System.out.println( C);
{
}
}
}
| Main.java:3: error: class findSecond is public, should be declared in a file named findSecond.java
public class findSecond
^
1 error
|
s366279556 | p03844 | Java | import java.io.*;
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
str = sc.nextString();
int b = sc.nextInt();
if(str == "+") {
System.out.println(a + b);
} else{
System.out.prinln(a - b);
}
}
} | Main.java:7: error: cannot find symbol
str = sc.nextString();
^
symbol: variable str
location: class Main
Main.java:7: error: cannot find symbol
str = sc.nextString();
^
symbol: method nextString()
location: variable sc of type Scanner
Main.java:9: error: cannot find symbol
if(str == "+") {
^
symbol: variable str
location: class Main
Main.java:12: error: cannot find symbol
System.out.prinln(a - b);
^
symbol: method prinln(int)
location: variable out of type PrintStream
4 errors
|
s957518075 | p03844 | Java | import java.io.*;
import java.util.Scanner;
public class AddSubtract {
// scanner to read
final Scanner scan = new Scanner(System.in);
// variables
int A = scan.nextInt();
int B = scan.nextInt();
String op = scan.next();
//the works baby
if (op.equals("-")){
System.out.println(A-B);
}
System.out.println(A+B);
} | Main.java:13: error: illegal start of type
if (op.equals("-")){
^
Main.java:13: error: <identifier> expected
if (op.equals("-")){
^
Main.java:13: error: illegal start of type
if (op.equals("-")){
^
Main.java:16: error: <identifier> expected
System.out.println(A+B);
^
Main.java:16: error: <identifier> expected
System.out.println(A+B);
^
5 errors
|
s654548925 | p03844 | C++ | #include<cstdio>
int main()
{
int a,c;
char b,n,m;
int sum;
while(scanf("%d",&a)!=EOF)
{
scanf("%c",&m);
scanf("%c",&b);
scanf("%c",&n);
scanf("%d",&c);
if(b==43)
{
sum=a+c;
printf("%d\n",sum);
}
else
{
sum=a-c;
printf("%d\n",sum);
}
}
return 0; | a.cc: In function 'int main()':
a.cc:25:19: error: expected '}' at end of input
25 | return 0;
| ^
a.cc:3:1: note: to match this '{'
3 | {
| ^
|
s824416535 | p03844 | Java | import java.util.Scanner;
public class AddSubtract {
public static void main(String[] args) {
// scanner to read
final Scanner scan = new Scanner(System.in);
// variables
int A = scan.nextInt();
int B = scan.nextInt();
String op = scan.next();
//the works baby
if (op.equals("-")){
System.out.println(A-B);
}
System.out.println(A+B);
}
} | Main.java:3: error: class AddSubtract is public, should be declared in a file named AddSubtract.java
public class AddSubtract {
^
1 error
|
s701918094 | p03844 | C++ | #include<cstdio>
int main()
{
int a,c;
char b,n,m;
int sum;
while(scanf("%d",&a)!=EOF)
{
scanf("%c",&m);
scanf("%c",&b);
scanf("%c",&n);
scanf("%d",&c);
if(b==43)
{
sum=a+c;
printf("%d\n",sum);
}
else
{
sum=a-c;
printf("%d\n",sum);
}
}
return 0; | a.cc: In function 'int main()':
a.cc:25:19: error: expected '}' at end of input
25 | return 0;
| ^
a.cc:3:1: note: to match this '{'
3 | {
| ^
|
s314383002 | p03844 | Java | import java.io.*;
import java.util.Scanner;
public class AddSubtract {
public static void main(String[] args) {
// scanner to read
final Scanner scan = new Scanner(System.in);
// variables
int A = scan.nextInt();
int B = scan.nextInt();
String op = scan.next();
//the works baby
if (op.equals("-")){
System.out.println(A-B);
}
System.out.println(A+B);
}
} | Main.java:4: error: class AddSubtract is public, should be declared in a file named AddSubtract.java
public class AddSubtract {
^
1 error
|
s842774716 | p03844 | Java | public class Main {
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
int A;
int B;
String op;
int output = 0;
String input = sc.nextLine();
A = Integer.parseInt(input.substring(0, 1));
op = input.substring(1, 2);
B = Integer.parseInt(input.substring(2, 3));
if(op.equals("+"))
{
output = A + B;
}
else if(op.equals("-"))
{
output = A - B;
}
System.out.println(output);
}
} | Main.java:4: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:4: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
2 errors
|
s521316207 | p03844 | Java | public class Main {
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
int A;
int B;
String op;
int output = 0;
String input = sc.nextLine();
A = Integer.parseInt(input.substring(0, 1));
op = input.substring(1, 2);
B = Integer.parseInt(input.substring(2, 3));
if(op.equals("+"))
{
output = A + B;
}
else if(op.equals("-"))
{
output = A - B;
}
System.out.println(output);
}
| Main.java:26: error: reached end of file while parsing
}
^
1 error
|
s425219614 | p03844 | Java | import java.util.Scanner;
public class AddSubtract {
public static void main(String[] args) {
// scanner to read
final Scanner scan = new Scanner(System.in);
// variables
int A = scan.nextInt();
int B = scan.nextInt();
String op = scan.next();
//the works baby
if (op.equals("-")){
System.out.println(A-B);
}
System.out.println(A+B);
}
}
| Main.java:3: error: class AddSubtract is public, should be declared in a file named AddSubtract.java
public class AddSubtract {
^
1 error
|
s574303602 | p03844 | Java |
import java.util.Scanner;
public class ADD
{
public static void main(String[] args)
{
int A;
int B;
int C;
Scanner N = new Scanner(System.in);
A = N.nextInt();
B = N.nextInt();
C = A+B;
System.out.println( C);
{
}
}
}
| Main.java:4: error: class ADD is public, should be declared in a file named ADD.java
public class ADD
^
1 error
|
s464870840 | p03844 | Java | import java.util.Scanner;
public class blah {
public static void main() {
Scanner input = new Scanner(System.in);
String thing = input.nextLine();
String [] thingies = thing.split(" ");
int datThing = 0;
if (thingies[1].equals("+")) {
datThing = Integer.parseInt(thingies[0]) + Integer.parseInt(thingies[2]);
}
else {
datThing = Integer.parseInt(thingies[0]) + Integer.parseInt(thingies[2]);
}
System.out.println(datThing);
}
}
| Main.java:3: error: class blah is public, should be declared in a file named blah.java
public class blah {
^
1 error
|
s143445046 | p03844 | Java | import java.io.; import java.util.;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
str = sc.nextString();
int b = sc.nextInt();
if(str == "+") {
System.out.println(a + b);
} else{
System.out.prinln(a - b);
}
}
} | Main.java:1: error: <identifier> expected
import java.io.; import java.util.;
^
Main.java:1: error: <identifier> expected
import java.io.; import java.util.;
^
2 errors
|
s348489080 | p03844 | C++ | #include <stdio.h>
#include <stdlib.h>
int main()
{
int a,b;
char z;
char c;
char x;
scanf("%d",&a);
c = getchar();
z = getchar();
x = getchar();
scanf("%d", &b);
int e, f;
if (c==43)
{
e = a + b;
printf("%d\n", e);
}
if (c==45)
{
f = a - b;
printf("%d\n", f);
}
system("pause");
| a.cc: In function 'int main()':
a.cc:25:25: error: expected '}' at end of input
25 | system("pause");
| ^
a.cc:4:1: note: to match this '{'
4 | {
| ^
|
s913105787 | p03844 | C++ | #include <stdio.h>
#include <stdlib.h>
int main()
{
int a,b;
char z;
char c;
char x;
scanf("%d",&a);
c = getchar();
z = getchar();
x = getchar();
scanf("%d", &b);
int e, f;
if (c==-)
{
e = a + b;
printf("%d\n", e);
}
if (c==+)
{
f = a - b;
printf("%d\n", f);
}
system("pause"); | a.cc: In function 'int main()':
a.cc:15:17: error: expected primary-expression before ')' token
15 | if (c==-)
| ^
a.cc:20:17: error: expected primary-expression before ')' token
20 | if (c==+)
| ^
a.cc:25:25: error: expected '}' at end of input
25 | system("pause");
| ^
a.cc:4:1: note: to match this '{'
4 | {
| ^
|
s200133162 | p03844 | Java | import java.io.*;
import java.util.*;
public class main
{
public static void main(String[] args)
{
Scanner scan = new Scanner(System.in);
int first = scan.nextInt();
String op = scan.next();
int second = scan.nextInt();
if(op.equals("+")) {
System.out.println(first + second);
} else {
System.out.println(first - second);
}
}
} | Main.java:4: error: class main is public, should be declared in a file named main.java
public class main
^
1 error
|
s194248992 | p03844 | Java | import java.io.*;
import java.util.*;
public class test
{
public static void main(String[] args)
{
Scanner scan = new Scanner(System.in);
int first = scan.nextInt();
String op = scan.next();
int second = scan.nextInt();
if(op.equals("+")) {
System.out.println(first + second);
} else {
System.out.println(first - second);
}
}
} | Main.java:4: error: class test is public, should be declared in a file named test.java
public class test
^
1 error
|
s328964243 | p03844 | Java |
Scanner s = new Scanner(System.in);
int a = s.nextInt();
String op = s.next();
int b = s.nextInt();
if(op.equals("+")){
System.out.println(a + b);
}
else if(op.equals("-")){
System.out.println(a - b);
}
return;
| Main.java:5: error: unnamed classes are a preview feature and are disabled by default.
Scanner s = new Scanner(System.in);
^
(use --enable-preview to enable unnamed classes)
Main.java:9: error: class, interface, enum, or record expected
if(op.equals("+")){
^
Main.java:11: error: class, interface, enum, or record expected
}
^
Main.java:14: error: class, interface, enum, or record expected
}
^
4 errors
|
s705376229 | p03844 | Java | import java.util.Scanner;
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int a = s.nextInt();
String op = s.next();
int b = s.nextInt();
if(op.equals("+")){
System.out.println(a + b);
}
else if(op.equals("-")){
System.out.println(a - b);
}
return;
}
| Main.java:4: error: unnamed classes are a preview feature and are disabled by default.
public static void main(String[] args) {
^
(use --enable-preview to enable unnamed classes)
1 error
|
s522251387 | p03844 | Java | import java.util.Scanner;
public class OpQuestion {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int a = s.nextInt();
String op = s.next();
int b = s.nextInt();
if(op.equals("+")){
System.out.println(a + b);
}
else if(op.equals("-")){
System.out.println(a - b);
}
return;
}
} | Main.java:3: error: class OpQuestion is public, should be declared in a file named OpQuestion.java
public class OpQuestion {
^
1 error
|
s413338089 | p03844 | Java | int main(int argc, char *argv[]){
Scanner s = new Scanner(System.in);
int a = s.nextInt();
String op = s.next();
int b = s.nextInt();
if(op.equals("+"){
System.out.println(a + b);
}
else if(op.equals("-"){
System.out.println(a - b);
else {
}
return;
}
| An exception has occurred in the compiler (21.0.9). Please file a bug against the Java compiler via the Java bug reporting page (https://bugreport.java.com) after checking the Bug Database (https://bugs.java.com) for duplicates. Include your program, the following diagnostic, and the parameters passed to the Java compiler in your report. Thank you.
java.lang.AssertionError
at jdk.compiler/com.sun.tools.javac.parser.VirtualParser$VirtualScanner.errPos(VirtualParser.java:151)
at jdk.compiler/com.sun.tools.javac.parser.JavacParser.doRecover(JavacParser.java:3124)
at jdk.compiler/com.sun.tools.javac.parser.JavacParser.parseSimpleStatement(JavacParser.java:3093)
at jdk.compiler/com.sun.tools.javac.parser.JavacParser.blockStatement(JavacParser.java:2820)
at jdk.compiler/com.sun.tools.javac.parser.JavacParser.blockStatements(JavacParser.java:2757)
at jdk.compiler/com.sun.tools.javac.parser.JavacParser.block(JavacParser.java:2727)
at jdk.compiler/com.sun.tools.javac.parser.JavacParser.block(JavacParser.java:2741)
at jdk.compiler/com.sun.tools.javac.parser.JavacParser.parseSimpleStatement(JavacParser.java:2968)
at jdk.compiler/com.sun.tools.javac.parser.JavacParser.blockStatement(JavacParser.java:2820)
at jdk.compiler/com.sun.tools.javac.parser.JavacParser.parseStatementAsBlock(JavacParser.java:2782)
at jdk.compiler/com.sun.tools.javac.parser.JavacParser.parseSimpleStatement(JavacParser.java:2972)
at jdk.compiler/com.sun.tools.javac.parser.JavacParser.blockStatement(JavacParser.java:2820)
at jdk.compiler/com.sun.tools.javac.parser.JavacParser.parseStatementAsBlock(JavacParser.java:2782)
at jdk.compiler/com.sun.tools.javac.parser.JavacParser.parseSimpleStatement(JavacParser.java:2976)
at jdk.compiler/com.sun.tools.javac.parser.JavacParser.blockStatement(JavacParser.java:2820)
at jdk.compiler/com.sun.tools.javac.parser.JavacParser.blockStatements(JavacParser.java:2757)
at jdk.compiler/com.sun.tools.javac.parser.JavacParser.block(JavacParser.java:2727)
at jdk.compiler/com.sun.tools.javac.parser.JavacParser.block(JavacParser.java:2741)
at jdk.compiler/com.sun.tools.javac.parser.JavacParser.methodDeclaratorRest(JavacParser.java:4920)
at jdk.compiler/com.sun.tools.javac.parser.JavacParser.topLevelMethodOrFieldDeclaration(JavacParser.java:4780)
at jdk.compiler/com.sun.tools.javac.parser.JavacParser.parseCompilationUnit(JavacParser.java:3997)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.parse(JavaCompiler.java:652)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.parse(JavaCompiler.java:629)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.parse(JavaCompiler.java:689)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.parseFiles(JavaCompiler.java:1036)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler$InitialFileParser.parse(JavaCompiler.java:1973)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.parseFiles(JavaCompiler.java:1023)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:949)
at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:319)
at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:178)
at jdk.compiler/com.sun.tools.javac.Main.compile(Main.java:64)
at jdk.compiler/com.sun.tools.javac.Main.main(Main.java:50)
printing javac parameters to: /w/javac.20260128_205423.args
|
s840276373 | p03844 | Java | import java.util.*;
public class OP{
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 K=0;
switch(OP) {
case "+":
K=A+B;
System.out.println(K);
break;
case "-":
K=A-B;
System.out.println(K);
}
}
} | Main.java:2: error: class OP is public, should be declared in a file named OP.java
public class OP{
^
1 error
|
s813677583 | p03844 | C++ | # include <stdio.h>
#include <stdlib.h>
int main()
{
int a,b;
char c;
scanf_s("%d",&a);
c = getchar();
scanf_s("%d", &b);
int e, f;
if (c==43)
{
e = a + b;
printf("%d\n", e);
}
if (c==45)
{
f = a - b;
printf("%d\n", f);
}
system("pause");
}
| a.cc: In function 'int main()':
a.cc:7:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
7 | scanf_s("%d",&a);
| ^~~~~~~
| scanf
|
s792057384 | p03844 | C | #include <stdio.h>
int main() {
int A op B;
if (op==-) {
printf ("%d\n",A-B); }
else if (op==+) {
printf ("%d\n",A+B);
}
return 0;
}
| main.c: In function 'main':
main.c:4:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'op'
4 | int A op B;
| ^~
main.c:4:15: error: unknown type name 'op'
main.c:5:13: error: 'op' undeclared (first use in this function)
5 | if (op==-) {
| ^~
main.c:5:13: note: each undeclared identifier is reported only once for each function it appears in
main.c:5:18: error: expected expression before ')' token
5 | if (op==-) {
| ^
main.c:6:32: error: 'A' undeclared (first use in this function)
6 | printf ("%d\n",A-B); }
| ^
main.c:7:23: error: expected expression before ')' token
7 | else if (op==+) {
| ^
|
s876982925 | p03844 | C | #include<stdio.h>
#include<math.h>
int main(){
long n;
scanf(“%ld”,&n);
long a[n];
int ans=1;
for(long i=0;i<n;i++){
scanf(“%ld”,&a[i]);
}
int chek=0;
for(long i=0;i<(n/2)+n%2;i++){
chek=0;
if(n%2==1){
for(long j=0;j<n;j++){
if(i==0){
if(i==a[j])chek+=2;
}else{
if(i*2==a[j])chek+=1;
}
}
}else{
for(long j=0;j<n;j++){
if(i*2+1==a[j])chek+=1;
}
}
if(chek!=2){
ans=0;
break;
}
}
if(ans==0){
printf(“%d\n”,ans);
}else{
long x=pow(10,9)+7;
unsigned long y=pow(2,(n-n%2)/2);
y=y%x;
printf(“%ld\n”,y);
}
} | main.c: In function 'main':
main.c:5:9: error: stray '\342' in program
5 | scanf(<U+201C>%ld<U+201D>,&n);
| ^~~~~~~~
main.c:5:10: error: expected expression before '%' token
5 | scanf(“%ld”,&n);
| ^
main.c:5:13: error: stray '\342' in program
5 | scanf(<U+201C>%ld<U+201D>,&n);
| ^~~~~~~~
main.c:9:13: error: stray '\342' in program
9 | scanf(<U+201C>%ld<U+201D>,&a[i]);
| ^~~~~~~~
main.c:9:14: error: expected expression before '%' token
9 | scanf(“%ld”,&a[i]);
| ^
main.c:9:17: error: stray '\342' in program
9 | scanf(<U+201C>%ld<U+201D>,&a[i]);
| ^~~~~~~~
main.c:34:14: error: stray '\342' in program
34 | printf(<U+201C>%d\n<U+201D>,ans);
| ^~~~~~~~
main.c:34:15: error: expected expression before '%' token
34 | printf(“%d\n”,ans);
| ^
main.c:34:17: error: stray '\' in program
34 | printf(“%d\n”,ans);
| ^
main.c:34:19: error: stray '\342' in program
34 | printf(<U+201C>%d\n<U+201D>,ans);
| ^~~~~~~~
main.c:39:14: error: stray '\342' in program
39 | printf(<U+201C>%ld\n<U+201D>,y);
| ^~~~~~~~
main.c:39:15: error: expected expression before '%' token
39 | printf(“%ld\n”,y);
| ^
main.c:39:18: error: stray '\' in program
39 | printf(“%ld\n”,y);
| ^
main.c:39:20: error: stray '\342' in program
39 | printf(<U+201C>%ld\n<U+201D>,y);
| ^~~~~~~~
|
s711448614 | p03844 | C++ | #include<iostream>
using namespace std;
int main() {
int a,op,b;
cin >> a >> op >> b;
if (op == "+") {
cout << a + b << endl;
} else {
cout << a - b << endl;
}
}
| a.cc: In function 'int main()':
a.cc:7:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
7 | if (op == "+") {
| ~~~^~~~~~
|
s293091779 | p03844 | C++ | #include<iostream>
using namespace std;
int main() {
int a,op,b;
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:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
7 | if (op == "+") {
| ~~~^~~~~~
a.cc:9:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
9 | } else if (op == "-") {
| ~~~^~~~~~
|
s151802469 | p03844 | C++ | #include<iostream>
using namespace std;
int main() {
int a,op,b;
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:14: error: expected primary-expression before ')' token
7 | if (op == +) {
| ^
a.cc:9:21: error: expected primary-expression before ')' token
9 | } else if (op == -) {
| ^
|
s551974890 | p03844 | C | #include <stdio.h>
int main(void){
//
int a, b;
char c;
//
scanf("%d %c %d",a,c,b);
//
if(c == '+')
printf("%d\n",a+b);
else
printf("%d\n",a-b)
return 0;
} | main.c: In function 'main':
main.c:12:27: error: expected ';' before 'return'
12 | printf("%d\n",a-b)
| ^
| ;
13 | return 0;
| ~~~~~~
|
s774986548 | p03844 | C | #include<studio.h>
using namespace std;
map<int,int>q;
long long h,m;
char s;
int main()
{
scanf("%lld %c %lld",&h,&s,&m);
if(s=='+')
{
printf("%lld\n",h+m);
}
else
{
printf("%lld\n",h-m);
}
return 0;
} | main.c:1:9: fatal error: studio.h: No such file or directory
1 | #include<studio.h>
| ^~~~~~~~~~
compilation terminated.
|
s546298973 | p03844 | Java | import java.util.Scanner;
public class main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int int1 = sc.nextInt();
String str = sc.next();
int int2 = sc.nextInt();
if(str.equals("+")){
System.out.println(int1 + int2);
}else{
System.out.println(int1 - int2);
}
}
} | Main.java:3: error: class main is public, should be declared in a file named main.java
public class main {
^
1 error
|
s149491077 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string op;
int A,B;
cin >> A >> op >> B;
if(op ==“+”){
cout << A+B<< endl;
}else{
cout<< A-B << endl;
} | a.cc:8:11: error: extended character “ is not valid in an identifier
8 | if(op ==“+”){
| ^
a.cc:8:13: error: extended character ” is not valid in an identifier
8 | if(op ==“+”){
| ^
a.cc: In function 'int main()':
a.cc:8:11: error: '\U0000201c' was not declared in this scope
8 | if(op ==“+”){
| ^
a.cc:8:13: error: '\U0000201d' was not declared in this scope
8 | if(op ==“+”){
| ^
a.cc:12:2: error: expected '}' at end of input
12 | }
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s061361927 | p03844 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int a,b;
char str;
cin >> a >> str >> b;
if(str=="+"){
cout << a+b << endl;
}
else{
cout << a-b << endl;
}
}
| a.cc: In function 'int main()':
a.cc:9:9: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
9 | if(str=="+"){
| ~~~^~~~~
|
s839613935 | p03844 | C | #include "pch.h"
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main(void)
{
//整数//
int a, b;
//結果//
int result;
//演算子//
char op;
//入力//
scanf_s("%d", &a);
scanf_s(" %c", &op);
scanf_s("%d", &b);
//出力//
if (op == '+') {
result = a + b;
printf("%d", result);
}
else {
result = a - b;
printf("%d", result);
}
return 0;
} | main.c:1:10: fatal error: pch.h: No such file or directory
1 | #include "pch.h"
| ^~~~~~~
compilation terminated.
|
s404780236 | p03844 | C++ | #include "pch.h"
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main(void)
{
//整数//
int a, b;
//結果//
int result;
//演算子//
char op;
//入力//
scanf_s("%d", &a);
scanf_s(" %c", &op);
scanf_s("%d", &b);
//出力//
if (op == '+') {
result = a + b;
printf("%d", result);
}
else {
result = a - b;
printf("%d", result);
}
return 0;
} | a.cc:1:10: fatal error: pch.h: No such file or directory
1 | #include "pch.h"
| ^~~~~~~
compilation terminated.
|
s090539545 | p03844 | C++ | include <iostream>
int main() {
int A, B;
char op;
std::cin >> A >> op >> B;
int eval = 0;
if ( op == '+' ) {
eval = A + B;
} else if ( op == '-' ) {
eval = A - B;
}
std::cout << eval << std::endl;
return 0;
}
| a.cc:1:1: error: 'include' does not name a type
1 | include <iostream>
| ^~~~~~~
|
s757959253 | p03844 | Java | import java.util.*;
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;
if(op.chatAt(0)=='+') ans = A+B;
else ans = A-B;
System.out.println(ans);
}
}
| Main.java:10: error: cannot find symbol
if(op.chatAt(0)=='+') ans = A+B;
^
symbol: method chatAt(int)
location: variable op of type String
1 error
|
s810165491 | p03844 | C++ | using System;
public class Hey{
public static void Main(){
var line = Console.ReadLine().Split(' ');
if(line[1] == '+') Console.WriteLine(line[0]+line[2]);
else Console.WriteLine(line[0]-line[2]);
}
} | a.cc:1:7: error: expected nested-name-specifier before 'System'
1 | using System;
| ^~~~~~
a.cc:3:1: error: expected unqualified-id before 'public'
3 | public class Hey{
| ^~~~~~
|
s963104484 | p03844 | C++ | ghoge | a.cc:1:1: error: 'ghoge' does not name a type
1 | ghoge
| ^~~~~
|
s951197100 | p03844 | C++ | #include <string.h>
#include <iostream>
using namespace std;
int num1, num2;
char s[1];
cin >> num1 >> s >> num2;
if (strcmp(s, "+")==0) {
cout << num1 + num2 << endl;
}
if (strcmp(s, "-") == 0) {
cout << num1 - num2 << endl;
} | a.cc:6:9: error: 'cin' does not name a type
6 | cin >> num1 >> s >> num2;
| ^~~
a.cc:7:9: error: expected unqualified-id before 'if'
7 | if (strcmp(s, "+")==0) {
| ^~
a.cc:10:9: error: expected unqualified-id before 'if'
10 | if (strcmp(s, "-") == 0) {
| ^~
|
s097112093 | p03844 | C++ | int num1, num2;
char s[1];
cin >> num1 >> s >> num2;
if (strcmp(s, "+")==0) {
cout << num1 + num2 << endl;
}
if (strcmp(s, "-") == 0) {
cout << num1 - num2 << endl;
} | a.cc:3:9: error: 'cin' does not name a type
3 | cin >> num1 >> s >> num2;
| ^~~
a.cc:4:9: error: expected unqualified-id before 'if'
4 | if (strcmp(s, "+")==0) {
| ^~
a.cc:7:9: error: expected unqualified-id before 'if'
7 | if (strcmp(s, "-") == 0) {
| ^~
|
s419300836 | p03844 | C++ | #include <iostream>
using namespace std;
int main() {
int num1, num2;
char s[1];
//scanf("%d %s %d", &num1, s, &num2);
cin >> num1 >> s >> num2;
if (strcmp(s, "+")==0) {
cout << num1 + num2 << endl;
}
else {
cout << num1 - num2 << endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:8:13: error: 'strcmp' was not declared in this scope
8 | if (strcmp(s, "+")==0) {
| ^~~~~~
a.cc:2:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include <iostream>
+++ |+#include <cstring>
2 | using namespace std;
|
s566378994 | p03844 | C++ | #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>
void main() {
int num1, num2;
char s[1];
scanf("%d %s %d", &num1, s, &num2);
if (strcmp(s, "+")==0) {
printf("%d", num1 + num2);
}
else {
printf("%d", num1 - num2);
}
} | a.cc:4:1: error: '::main' must return 'int'
4 | void main() {
| ^~~~
|
s088021895 | p03844 | C++ | #include <iostream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <cmath>
#include <climits>
#define F first
#define S second
#define vsort(v) sort((v).begin(), (v).end())
#define vrev(v) reverse((v).begin(), (v).end())
//INT_MAX
//INT_MIN
//LLONG_MAX
//LLONG_MIN
//DBL_MIN
//DBL_MAX
//LDBL_MIN
//LDBL_MAX
using namespace std;
using ll = long long;
int main(int argc, const char * argv[]) {
ll 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(int, const char**)':
a.cc:28:12: error: expected initializer before ':' token
28 | ll a, b:
| ^
a.cc:30:17: error: 'op' was not declared in this scope
30 | cin >> a >> op >> b;
| ^~
a.cc:30:23: error: 'b' was not declared in this scope
30 | cin >> a >> op >> b;
| ^
|
s240659346 | p03844 | C++ | #include<iostream>
using namespace std;
int main(){
int a, b;
string op;
cin >> a >> op >> b;
switch(op){
case '+':
cout << a+b << endl;
break;
case '-':
cout << a-b << endl;
break;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:8:10: error: switch quantity not an integer
8 | switch(op){
| ^~
|
s252057929 | p03844 | C++ | #include<iostream>
using namespace std:
int main(){
int a, b;
string op;
cin >> a >> op >> b;
switch(op){
case '+':
cout << a+b << endl;
break;
case '-':
cout << a-b << endl;
break;
}
return 0;
} | a.cc:2:20: error: expected ';' before ':' token
2 | using namespace std:
| ^
| ;
a.cc:2:20: error: expected unqualified-id before ':' token
|
s251482516 | p03844 | C++ | #include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);i++)
const int MOD=(int)1e9+7;
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:9:11: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
9 | if(op == '+') cout << a + b << endl;
| ~~ ^~ ~~~
| | |
| | char
| std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/regex:68,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181,
from a.cc:1:
/usr/include/c++/14/bits/regex.h:1103:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const sub_match<_BiIter>&)'
1103 | operator==(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1103:5: note: template argument deduction/substitution failed:
a.cc:9:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
9 | 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:9:14: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char'
9 | 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:9:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
9 | 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:9:14: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char'
9 | 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:9:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
9 | 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:9:14: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char'
9 | 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:9:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
9 | 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:9:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::match_results<_BiIter, _Alloc>'
9 | if(op == '+') cout << a + b << endl;
| ^~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/bits/stl_pair.h:1033:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator==(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1033 | operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1033:5: note: template argument deduction/substitution failed:
a.cc:9:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>'
9 | if(op == '+') cout << a + b << endl;
| ^~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:67:
/usr/include/c++/14/bits/stl_iterator.h:441:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
441 | operator==(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:441:5: note: template argument deduction/substitution failed:
a.cc:9:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
9 | if(op == '+') cout << a + b << endl;
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:486:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
486 | operator==(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:486:5: note: template argument deduction/substitution failed:
a.cc:9:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
9 | if(op == '+') cout << a + b << endl;
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:1667:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1667 | operator==(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1667:5: note: template argument deduction/substitution failed:
a.cc:9:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
9 | if(op == '+') cout << a + b << endl;
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:1737:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1737 | operator==(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1737:5: note: template argument deduction/substitution failed:
a.cc:9:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
9 | if(op == '+') cout << a + b << endl;
| ^~~
In file included from /usr/include/c++/14/bits/char_traits.h:42,
from /usr/include/c++/14/string:42,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/bits/postypes.h:192:5: note: candidate: 'template<class _StateT> bool std::operator==(const fpos<_StateT>&, const fpos<_StateT>&)'
192 | operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/postypes.h:192:5: note: template argument deduction/substitution failed:
a.cc:9:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::fpos<_StateT>'
9 | if(op == '+') cout << a + b << endl;
| ^~~
In file included from /usr/include/c++/14/string:43:
/usr/include/c++/14/bits/allocator.h:235:5: note: candidate: 'template<class _T1, class _T2> bool std::operator==(const allocator<_CharT>&, const allocator<_T2>&)'
235 | operator==(const allocator<_T1>&, const allocator<_T2>&)
| ^~~~~~~~
/usr/include/c++/14/bits/allocator.h:235:5: note: template argument deduction/substitution failed:
a.cc:9:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::allocator<_CharT>'
9 | if(op == '+') cout << a + b << endl;
| ^~~
In file included from /usr/include/c++/14/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, _Tr |
s075330888 | p03844 | C++ | #include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);i++)
const int MOD=(int)1e9+7;
using namespace std;
int main(){
int a,b;
string op;
cin >> a >> b >> op;
if(op == '+') cout << a + b << endl;
else cout << a - b << endl;
} | a.cc: In function 'int main()':
a.cc:9:11: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
9 | if(op == '+') cout << a + b << endl;
| ~~ ^~ ~~~
| | |
| | char
| std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/regex:68,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181,
from a.cc:1:
/usr/include/c++/14/bits/regex.h:1103:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const sub_match<_BiIter>&)'
1103 | operator==(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1103:5: note: template argument deduction/substitution failed:
a.cc:9:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
9 | 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:9:14: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char'
9 | 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:9:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
9 | 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:9:14: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char'
9 | 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:9:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
9 | 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:9:14: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char'
9 | 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:9:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
9 | 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:9:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::match_results<_BiIter, _Alloc>'
9 | if(op == '+') cout << a + b << endl;
| ^~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/bits/stl_pair.h:1033:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator==(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1033 | operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1033:5: note: template argument deduction/substitution failed:
a.cc:9:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>'
9 | if(op == '+') cout << a + b << endl;
| ^~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:67:
/usr/include/c++/14/bits/stl_iterator.h:441:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
441 | operator==(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:441:5: note: template argument deduction/substitution failed:
a.cc:9:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
9 | if(op == '+') cout << a + b << endl;
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:486:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
486 | operator==(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:486:5: note: template argument deduction/substitution failed:
a.cc:9:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
9 | if(op == '+') cout << a + b << endl;
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:1667:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1667 | operator==(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1667:5: note: template argument deduction/substitution failed:
a.cc:9:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
9 | if(op == '+') cout << a + b << endl;
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:1737:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1737 | operator==(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1737:5: note: template argument deduction/substitution failed:
a.cc:9:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
9 | if(op == '+') cout << a + b << endl;
| ^~~
In file included from /usr/include/c++/14/bits/char_traits.h:42,
from /usr/include/c++/14/string:42,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/bits/postypes.h:192:5: note: candidate: 'template<class _StateT> bool std::operator==(const fpos<_StateT>&, const fpos<_StateT>&)'
192 | operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/postypes.h:192:5: note: template argument deduction/substitution failed:
a.cc:9:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::fpos<_StateT>'
9 | if(op == '+') cout << a + b << endl;
| ^~~
In file included from /usr/include/c++/14/string:43:
/usr/include/c++/14/bits/allocator.h:235:5: note: candidate: 'template<class _T1, class _T2> bool std::operator==(const allocator<_CharT>&, const allocator<_T2>&)'
235 | operator==(const allocator<_T1>&, const allocator<_T2>&)
| ^~~~~~~~
/usr/include/c++/14/bits/allocator.h:235:5: note: template argument deduction/substitution failed:
a.cc:9:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::allocator<_CharT>'
9 | if(op == '+') cout << a + b << endl;
| ^~~
In file included from /usr/include/c++/14/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, _Tr |
s967090379 | p03844 | C++ | #include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);i++)
const int MOD=(int)1e9+7;
using namespace std;
int main(){
int a,b,op;
cin >> a >> b >> op;
if(op == '+') cout << a += b << endl;
else cout << a -= b << endl;
} | a.cc: In function 'int main()':
a.cc:8:34: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
8 | if(op == '+') cout << a += b << endl;
| ~~^~~~~~~
a.cc:9:25: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
9 | else cout << a -= b << endl;
| ~~^~~~~~~
|
s943263198 | p03844 | C++ | #include<iostream>
using namespace std;
int main()
{while(1)
{cout<<“AC”<<endl;
}
return 0;}
| a.cc:5:9: error: extended character “ is not valid in an identifier
5 | {cout<<“AC”<<endl;
| ^
a.cc:5:9: error: extended character ” is not valid in an identifier
a.cc: In function 'int main()':
a.cc:5:9: error: '\U0000201cAC\U0000201d' was not declared in this scope
5 | {cout<<“AC”<<endl;
| ^~~~
|
s041939111 | 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{
cout<<a-b<<endl;
}
return 0;!
} | a.cc: In function 'int main()':
a.cc:14:14: error: '\U0000ff01' was not declared in this scope
14 | return 0;!
| ^~
|
s676829168 | p03844 | C++ | #include <iostream>
#include <string>
using namespace std;
int main(){
int a,c;
char b;
cin>>a>>b>>c;
if(b==+){cout<<a+c<<endl;}
else{cout<<a-c<<endl;}
return 0;
}
| a.cc: In function 'int main()':
a.cc:8:10: error: expected primary-expression before ')' token
8 | if(b==+){cout<<a+c<<endl;}
| ^
|
s645156051 | p03844 | C++ | #include<iostream>
using namespace std;
int main(void){
char c;
int a,b;
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:7:7: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
7 | if(c=="+"){
| ~^~~~~
|
s020333958 | p03844 | C++ | #include <iostream>
#include <cstdlib>
#include <cstring>
int main()
{
int m, n;
string op;
std::cin >> m >> op >> n;
if ( !strcmp(op, "+") ) std::cout << (m + n) << std::endl;
if ( !strcmp(op, "-") ) std::cout << (m - n) << std::endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:8:5: error: 'string' was not declared in this scope
8 | string op;
| ^~~~~~
a.cc:8:5: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
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/stringfwd.h:77:33: note: 'std::string'
77 | typedef basic_string<char> string;
| ^~~~~~
In file included 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/string:76:11: note: 'std::pmr::string'
76 | using string = basic_string<char>;
| ^~~~~~
a.cc:10:22: error: 'op' was not declared in this scope
10 | std::cin >> m >> op >> n;
| ^~
|
s645730131 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int a, c;
string b;
int main(){
cin<<a<<b<<c;
if(b == "+"){
cout<<a+c<<endl;
}else{
cout<<a-c<<endl;
}
} | a.cc: In function 'int main()':
a.cc:7:6: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int')
7 | cin<<a<<b<<c;
| ~~~^~~
| | |
| | int
| std::istream {aka std::basic_istream<char>}
a.cc:7:6: note: candidate: 'operator<<(int, int)' (built-in)
7 | cin<<a<<b<<c;
| ~~~^~~
a.cc:7:6: 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:8: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
7 | cin<<a<<b<<c;
| ^
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<<b<<c;
| ^~~
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:8: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
7 | cin<<a<<b<<c;
| ^
/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:8: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
7 | cin<<a<<b<<c;
| ^
/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:8: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
7 | cin<<a<<b<<c;
| ^
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:8: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
7 | cin<<a<<b<<c;
| ^
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:8: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
7 | cin<<a<<b<<c;
| ^
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:8: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
7 | cin<<a<<b<<c;
| ^
/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:8: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
7 | cin<<a<<b<<c;
| ^
/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:8: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
7 | cin<<a<<b<<c;
| ^
/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:8: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
7 | cin<<a<<b<<c;
| ^
/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:8: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
7 | cin<<a<<b<<c;
| ^
/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:8: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
7 | cin<<a<<b<<c;
| ^
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:8: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
7 | cin<<a<<b<<c;
| ^
/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:8: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
7 | cin<<a<<b<<c;
| ^
/usr/include/c++/14/ostream:684:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const sig |
s608470872 | 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
cout<<a-b<<endl;
return 0;!
} | a.cc: In function 'int main()':
a.cc:12:14: error: '\U0000ff01' was not declared in this scope
12 | return 0;!
| ^~
|
s792903952 | p03844 | C++ | #include <bits/stdc++.h>
#include <ctype.h>
using namespace std;
int main(void){
int a, p;
char op;
cin >> a >> op >> p;
cout << (op=='+'?a+b:a-b) << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:11:22: error: 'b' was not declared in this scope
11 | cout << (op=='+'?a+b:a-b) << endl;
| ^
|
s161903578 | p03844 | C++ | #include <bits/stdc++.h>
#include <ctype.h>
using namespace std;
int main(void){
int a, p;
char op;
cin >> a >> op >> p;
cout << (OP=='+'?a+b:a-b) << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:11:12: error: 'OP' was not declared in this scope; did you mean 'op'?
11 | cout << (OP=='+'?a+b:a-b) << endl;
| ^~
| op
a.cc:11:22: error: 'b' was not declared in this scope
11 | cout << (OP=='+'?a+b:a-b) << endl;
| ^
|
s119895850 | p03844 | C++ | #include<stdio.h>
#define INF 1000000000
int main(void){
int A,B;
int res;
char op;
printf("enter two numbers and an operand\n");
printf("A = ");
scanf("%d",&A);
while(0<=A && A <= INF){
printf("out of range\n");
scanf("%d",&A);
}
printf("op is");
op = getchar();
while(op == '+' || op == '-'){
print("Unkown error!\n");
op = getchar();
}
printf("\nB = ");
scanf("%d",&B);
while(0<=B && B <= INF){
printf("out of range\n");
scanf("%d",&B);
}
if(op == '+'){
res = A + B;
printf("The answer is %d\n",res);
}
else if(op == '-'){
res = A - B;
printf("The answer is %d\n",res);
}
else{
printf("error!\n");
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:20:5: error: 'print' was not declared in this scope; did you mean 'printf'?
20 | print("Unkown error!\n");
| ^~~~~
| printf
|
s593087694 | p03844 | C++ | #include<stdio.h>
#define INF 1000000000
int main(void){
int A,B;
int res;
char op;
printf("enter two numbers and an operand\n");
printf("A = ");
scanf("%d",&A);
while(0<=A && A <= INF){
printf("out of range\n");
scanf("%d",&A);
}
printf("op is");
scanf("%c",op);
while(op == '+' || op == '-'){
print("Unkown error!\n");
scanf("%c",op);
}
printf("\nB = ");
scanf("%d",&B);
while(0<=B && B <= INF){
pritnf("out of range\n");
scanf("%d",&B);
}
if(op == '+'){
res = A + B;
printf("The answer is %d\n",res);
}
if else(op == '-'){
res = A - B;
printf("The answer is %d\n",res);
}
else{
printf("error!\n");
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:20:5: error: 'print' was not declared in this scope; did you mean 'printf'?
20 | print("Unkown error!\n");
| ^~~~~
| printf
a.cc:26:5: error: 'pritnf' was not declared in this scope; did you mean 'printf'?
26 | pritnf("out of range\n");
| ^~~~~~
| printf
a.cc:34:6: error: expected '(' before 'else'
34 | if else(op == '-'){
| ^~~~
| (
a.cc:38:3: error: 'else' without a previous 'if'
38 | else{
| ^~~~
|
s632389307 | p03844 | C++ | #include <iostream>
#include <cstdlib>
int a,b,ans;
char c;
int main()
{
cin>>a>>c>>b;
if(c=='+') ans=a+b;
else ans=a-b;
cout<<ans<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:7:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
7 | cin>>a>>c>>b;
| ^~~
| std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:10:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
10 | cout<<ans<<endl;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:10:16: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
10 | cout<<ans<<endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s631461866 | p03844 | C++ | #include <iostream>
int a,b,ans;
char c;
int main()
{
cin>>a>>c>>b;
if(f=='+') ans=a+b;
else ans=a-b;
cout<<ans<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
6 | cin>>a>>c>>b;
| ^~~
| std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:7:8: error: 'f' was not declared in this scope
7 | if(f=='+') ans=a+b;
| ^
a.cc:9:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
9 | cout<<ans<<endl;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:9:16: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
9 | cout<<ans<<endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s906928235 | p03844 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
int a,b;
char h;
cin>>a>>h>>b;
if(h=='+')
cout<<a+b<<endl;
else
cout<<a-b<<endl;
return 0;!
| a.cc: In function 'int main()':
a.cc:12:14: error: '\U0000ff01' was not declared in this scope
12 | return 0;!
| ^~
a.cc:12:16: error: expected '}' at end of input
12 | return 0;!
| ^
a.cc:4:1: note: to match this '{'
4 | {
| ^
|
s908980638 | p03844 | C | #include <stdio.h>
int main(void) {
int a;
char e;
int b;
scanf("%d",&a);
scanf("%c",&e);
scanf("%d",&b);
if(e=='+'){
printf("%d",a+b);}
if(e=='-'{
printf("%d",a-b);}
return 0;
} | main.c: In function 'main':
main.c:12:11: error: expected ')' before '{' token
12 | if(e=='-'{
| ~ ^
| )
main.c:15:1: error: expected expression before '}' token
15 | }
| ^
|
s969827060 | p03844 | C++ | #include <string>
#include <sstream>
#include <iostream>
int main(){
int a, b;
string op;
cin >> a >> op >> b;
if (op == "+"){
cout << a + b << endl;
}else{
cout << a-b <<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:7:3: error: 'string' was not declared in this scope
7 | string op;
| ^~~~~~
a.cc:7:3: note: suggested alternatives:
In file included from /usr/include/c++/14/string:41,
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:8:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
8 | cin >> a >> op >> b;
| ^~~
| std::cin
In file included from a.cc:3:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:8:15: error: 'op' was not declared in this scope
8 | cin >> a >> op >> b;
| ^~
a.cc:10:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
10 | cout << a + b << endl;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:10:20: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
10 | cout << a + b << endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/istream:41,
from /usr/include/c++/14/sstream:40,
from a.cc:2:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
a.cc:12:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
12 | cout << a-b <<endl;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:12:17: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
12 | cout << a-b <<endl;
| ^~~~
| std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s542577959 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
string 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:7:6: error: expected ';' before 'A'
7 | cin A >> op >> B;
| ^~
| ;
|
s227420457 | p03844 | C++ | #include<iostream>
using namespace std;
int main(){
int N;
cin>>N;
int pp[N];
for(int i=0;i<N;i++)cin>>PP[i];
int M;
int o[M];
for(int y=0;y<M;y++)cin>>o[y];
for(y=0;y<N;y++){
int x;
cin>>x;
pp[y]=x;
for(int g=0;g<N;g++){
int z;
z=z+pp[g];
cout<<z<<endl;
}
return 0;
}
} | a.cc: In function 'int main()':
a.cc:8:26: error: 'PP' was not declared in this scope; did you mean 'pp'?
8 | for(int i=0;i<N;i++)cin>>PP[i];
| ^~
| pp
a.cc:12:5: error: 'y' was not declared in this scope
12 | for(y=0;y<N;y++){
| ^
|
s754961590 | p03844 | C++ | #include<iostream>
using namespace std;
int main(){
int N;
cin>>N;
int pp[N];
for(int i=0;i<N;i++)cin>>PP[i];
int M;
int o[M];
for(int y=0;y<M;y++)cin>>o[y];
for(y=0;y<N;y++){
int x;
cin>>x;
pp[y]=x;
for(int g=0;g<N;g++){
int z;
z=z+pp[g];
cout<<z<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:8:26: error: 'PP' was not declared in this scope; did you mean 'pp'?
8 | for(int i=0;i<N;i++)cin>>PP[i];
| ^~
| pp
a.cc:12:5: error: 'y' was not declared in this scope
12 | for(y=0;y<N;y++){
| ^
a.cc:22:2: error: expected '}' at end of input
22 | }
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s091614031 | p03844 | C++ | #include<iostream>
using namespace std;
int main(){
int N;
cin>>N;
int pp[N];
for(int i=0;i<N;i++)cin>>PP[i];
int M;
int o[M];
for(int y=0;y<M;y++)cin>>o[y];
int rr[N];
for(y=0;y<N;y++)cin>>rr[y];
int x;
cin>>x;
rr[p]=x;
for(int g=0;g<N;g++){
int z;
z=z+pp[g];
cout<<z<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:8:26: error: 'PP' was not declared in this scope; did you mean 'pp'?
8 | for(int i=0;i<N;i++)cin>>PP[i];
| ^~
| pp
a.cc:13:5: error: 'y' was not declared in this scope
13 | for(y=0;y<N;y++)cin>>rr[y];
| ^
a.cc:16:12: error: 'p' was not declared in this scope
16 | rr[p]=x;
| ^
|
s885512048 | p03844 | C++ | #include<iostream>
using namespace std;
int main(){
int N;
cin>>N;
int pp[N];
for(int i=0;i<N;i++)cin>>PP[i];
int M;
int o[M];
for(int y=0;y<M;y++)cin>>o[y];
int rr[N];
for(int p=0;p<N;p++)cin>>rr[p];
for(p=0;p<M;p++){
int x;
cin>>x;
rr[p]=x;
for(int g=0;g<N;g++){
int z;
z=z+pp[g];
cout<<z<<endl;
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:8:26: error: 'PP' was not declared in this scope; did you mean 'pp'?
8 | for(int i=0;i<N;i++)cin>>PP[i];
| ^~
| pp
a.cc:14:5: error: 'p' was not declared in this scope
14 | for(p=0;p<M;p++){
| ^
|
s290174253 | p03844 | C++ | #include<iostream>
using namespace std;
int main(){
int N;
cin>>N;
int pp[N];
for(int i=0;i<N;i++)cin>>PP[i];
int M;
int o[M];
for(int y=0;y<M;y++)cin>>o[y];
int rr[N];
for(int p=0;p<N;p++)cin>>rr[p];
y=p;
int x;
cin>>x;
rr[p]=x;
rr[N]=PP[N];
for(int g=0;g<N;g++){
int z;
z=z+pp[g];
cout<<z<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:8:26: error: 'PP' was not declared in this scope; did you mean 'pp'?
8 | for(int i=0;i<N;i++)cin>>PP[i];
| ^~
| pp
a.cc:14:1: error: 'y' was not declared in this scope
14 | y=p;
| ^
a.cc:14:3: error: 'p' was not declared in this scope
14 | y=p;
| ^
a.cc:18:15: error: 'PP' was not declared in this scope; did you mean 'pp'?
18 | rr[N]=PP[N];
| ^~
| pp
|
s115895387 | p03844 | C++ | #include<iostream>
using namespace std;
int main(){
int N;
cin>>N;
int pp[N];
for(int i=0;i<N;i++)cin>>PP[i];
int M;
int o[M];
for(int y=0;y<M;y++)cin>>o[y];
for(int p=0;p<N;p++)cin>>pp[p];
y=p;
int x;
cin>>x;
pp[p]=x;
for(int g=0;g<N;g++){
int z;
z=z+pp[g];
cout<<z<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:8:26: error: 'PP' was not declared in this scope; did you mean 'pp'?
8 | for(int i=0;i<N;i++)cin>>PP[i];
| ^~
| pp
a.cc:13:1: error: 'y' was not declared in this scope
13 | y=p;
| ^
a.cc:13:3: error: 'p' was not declared in this scope
13 | y=p;
| ^
|
s712803519 | p03844 | C++ | #include<iostream>
using namespace std;
int main(){
int N;
cin>>N;
int
for(int i=0;i<N;i++)cin>>PP[i];
int M;
for(int y=0;y<M;y++)cin>>o[y];
for(int p=0;p<N;p++)cin>>pp[p];
y=p;
int x;
cin>>x;
pp[p]=x;
for(int g=0;g<N;g++){
int z;
z=z+pp[g];
cout<<z<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:8:1: error: expected unqualified-id before 'for'
8 | for(int i=0;i<N;i++)cin>>PP[i];
| ^~~
a.cc:8:13: error: 'i' was not declared in this scope
8 | for(int i=0;i<N;i++)cin>>PP[i];
| ^
a.cc:10:26: error: 'o' was not declared in this scope
10 | for(int y=0;y<M;y++)cin>>o[y];
| ^
a.cc:11:26: error: 'pp' was not declared in this scope; did you mean 'p'?
11 | for(int p=0;p<N;p++)cin>>pp[p];
| ^~
| p
a.cc:12:1: error: 'y' was not declared in this scope
12 | y=p;
| ^
a.cc:12:3: error: 'p' was not declared in this scope
12 | y=p;
| ^
a.cc:15:9: error: 'pp' was not declared in this scope
15 | pp[p]=x;
| ^~
|
s106116671 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int A, B;
char op;
cin >> A >> op >> B;
if (op == '+'){
A+=B;
cout << A << endl;
}
else {
A-=B;
cout << A << endl;
} | a.cc: In function 'int main()':
a.cc:17:2: error: expected '}' at end of input
17 | }
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s353086273 | p03844 | Java | import java.util.Scanner;
class Main{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int op = sc.next();
int b = sc.nextInt();
if(op=="+"){
System.out.println(a+b);
}else{
System.out.println(a-b);
}
}
} | Main.java:6: error: incompatible types: String cannot be converted to int
int op = sc.next();
^
Main.java:8: error: bad operand types for binary operator '=='
if(op=="+"){
^
first type: int
second type: String
2 errors
|
s631002629 | p03844 | Java | import java.util.Scanner;
public 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.endsWith("+")) System.out.println(A+B);
else System.out.println(A-B);
}
}
| Main.java:2: error: class, interface, enum, or record expected
public Main {
^
Main.java:3: error: unnamed classes are a preview feature and are disabled by default.
public static void main(String[] args) {
^
(use --enable-preview to enable unnamed classes)
Main.java:11: error: class, interface, enum, or record expected
}
^
3 errors
|
s289728261 | p03844 | Java | import java.util.Scanner;
class example(){
public static void main(){
}
} | Main.java:3: error: '{' expected
class example(){
^
1 error
|
s162149482 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string c;
cin >> c;
if(c == "a" || c== "i" || c== "u" || c== "e" || c== "o"){
cout << "vowel" << endl;
}
else{
cout << "consonant" << endl;
}
}
#include <bits/stdc++.h>
using namespace std;
int main() {
int a,b;
string op;
if(op=="+"||op=="-")
cout << a << op << b << endl;
}
| a.cc:22:5: error: redefinition of 'int main()'
22 | int main() {
| ^~~~
a.cc:4:5: note: 'int main()' previously defined here
4 | int main() {
| ^~~~
|
s082500691 | p03844 | C++ | #include<iostream>
#include<algorithm>
#include<math.h>
#include<set>
#include<vector>
#include<map>
using namespace std;
int a;
char x;
int b;
cin>>a>>x>>b;
if(x=='+')
cout<<a+b<<endl;
else
cout<<a-b<<endl;
} | a.cc:11:1: error: 'cin' does not name a type
11 | cin>>a>>x>>b;
| ^~~
a.cc:12:1: error: expected unqualified-id before 'if'
12 | if(x=='+')
| ^~
a.cc:14:1: error: expected unqualified-id before 'else'
14 | else
| ^~~~
a.cc:16:1: error: expected declaration before '}' token
16 | }
| ^
|
s373596408 | p03844 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
long a,b;
char op;
cin>>a>>op>>b;
if(op=='+'){
cout<<a+b<<endl;
}
if(op=='-'){
cour<<a-b<<endl;
}
} | a.cc: In function 'int main()':
a.cc:11:5: error: 'cour' was not declared in this scope
11 | cour<<a-b<<endl;
| ^~~~
|
s783805835 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
long long a, b;
char n;
int >> a >> n >> b;
if(n == '+'){
cout << a + b << endl;
return 0;
}
cout << a - b << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:7:13: error: expected unqualified-id before '>>' token
7 | int >> a >> n >> b;
| ^~
|
s136054656 | p03844 | C++ | #include<bits/stdc++.h>
using namespace std;
int main{
int a,b;
char op;
cin>>a>>op>>b;
if(op=='+')cout<<a+b<<endl;
else cout<<a-b<<endl;
return 0;
} | a.cc:3:5: error: cannot declare '::main' to be a global variable
3 | int main{
| ^~~~
a.cc:4:3: error: expected primary-expression before 'int'
4 | int a,b;
| ^~~
a.cc:4:3: error: expected '}' before 'int'
a.cc:3:9: note: to match this '{'
3 | int main{
| ^
a.cc:6:3: error: 'cin' does not name a type
6 | cin>>a>>op>>b;
| ^~~
a.cc:7:3: error: expected unqualified-id before 'if'
7 | if(op=='+')cout<<a+b<<endl;
| ^~
a.cc:8:3: error: expected unqualified-id before 'else'
8 | else cout<<a-b<<endl;
| ^~~~
a.cc:9:3: error: expected unqualified-id before 'return'
9 | return 0;
| ^~~~~~
a.cc:10:1: error: expected declaration before '}' token
10 | }
| ^
|
s480704508 | p03844 | C++ | #include <bits/stdc++>
using namespace std;
int main(void) {
int a, b;
char op;
cin >> a >> op >> b;
if(op == '+') cout << a+b <<endl;
else if(op =='-') cout << a-b <<endl;
} | a.cc:1:10: fatal error: bits/stdc++: No such file or directory
1 | #include <bits/stdc++>
| ^~~~~~~~~~~~~
compilation terminated.
|
s322298716 | p03844 | C++ | #include <bits/stdc++>
using namespace std;
int main(void) {
int a, b;
char op;
cin >> a >> op >> b;
if(op == '+') cout << a+b <<endl;
else(op =='-') cout << a-b <<endl;
} | a.cc:1:10: fatal error: bits/stdc++: No such file or directory
1 | #include <bits/stdc++>
| ^~~~~~~~~~~~~
compilation terminated.
|
s453387927 | p03844 | C++ | int a,b;
string op;
cin>> a >> op >> b;
if(op == "+")
cout << a+b << endl;
else
cout << a-b << endl; | a.cc:2:1: error: 'string' does not name a type
2 | string op;
| ^~~~~~
a.cc:4:1: error: 'cin' does not name a type
4 | cin>> a >> op >> b;
| ^~~
a.cc:6:1: error: expected unqualified-id before 'if'
6 | if(op == "+")
| ^~
a.cc:9:1: error: expected unqualified-id before 'else'
9 | else
| ^~~~
|
s805082387 | 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;
else cout << A - B;
} | a.cc: In function 'int main()':
a.cc:8:9: error: could not convert 'op.std::__cxx11::basic_string<char>::operator=(((const char*)"+"))' from 'std::__cxx11::basic_string<char>' to 'bool'
8 | if(op = "+") cout << A + B;
| ~~~^~~~~
| |
| std::__cxx11::basic_string<char>
|
s902180091 | p03844 | C++ | #include <iostream>
using namespace std;
int main()
{
int a,b;
char op;
cin >> a >> op >> b;
if(op=="+"){
cout << (a + b) << endl;
}else{
cout << (a - b) << endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:9:8: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
9 | if(op=="+"){
| ~~^~~~~
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.