submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3 values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s132946788 | p03844 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
long long a,b;
char op;
scanf("%lld%c%lld",&a &op &b);
if(op=='+'){
printf("%lld",a+b);
}
else if(op=='-'){
printf("%lld",a-b);
}
} | a.cc: In function 'int main()':
a.cc:6:23: error: invalid operands of types 'long long int*' and 'char' to binary 'operator&'
6 | scanf("%lld%c%lld",&a &op &b);
| ~~ ^~~
| | |
| | char
| long long int*
|
s971321332 | p03844 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
long long a,b;
char op;
scanf("%lld%c%lld",&a &op &b);
if(op=='+'){
printf("%lld",a+b);
}
else if(op=='-'){
printf("%lld",a-b);
}
} | a.cc: In function 'int main()':
a.cc:6:23: error: invalid operands of types 'long long int*' and 'char' to binary 'operator&'
6 | scanf("%lld%c%lld",&a &op &b);
| ~~ ^~~
| | |
| | char
| long long int*
|
s745229978 | p03844 | C | #include <bits/stdc++.h>
using namespace std;
int main(){
int a,b;
char op;
scanf("%d%d%c",&a,&b,&op);
if(op=='+')
printf("%d",(a+b));
else if(op=='-')
printf("%d",(a-b));
return 0;
} | main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
1 | #include <bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s784575248 | p03844 | C++ | #include<bits\stdc++.h>
using namespace std;
int main(){
int a;
int b;
char x;
cin>>a>>x>>b;
// scanf("%d%c%d",&a,&x,&b);
switch(x){
case '-':
cout<<a-b;
break;
case '+':
cout<<a+b;
break;
}
return 0;
} | a.cc:1:9: fatal error: bits\stdc++.h: No such file or directory
1 | #include<bits\stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s497061430 | p03844 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
int a,b,x;
char s;
cin>>a>>s>>b;
if(s==43)
{
x=a+b;
cout<<x;}
else
{x=a-b;
cout<<x;
}
}
| a.cc:9:1: error: extended character is not valid in an identifier
9 | {
| ^
a.cc:13:1: error: extended character is not valid in an identifier
13 | {x=a-b;
| ^
a.cc: In function 'int main()':
a.cc:9:1: error: '\U000000a0' was not declared in this scope
9 | {
| ^
a.cc:13:1: error: '\U000000a0' was not declared in this scope
13 | {x=a-b;
| ^
|
s816448669 | p03844 | C++ | #include<bits\stdc++.h>
using namespace std;
int main(){
int a;
int b;
char x;
cin>>a>>x>>b;
if(x=='-')
cout<<a-b;
else if(x=='+')
cout<<a+b;
return 0;
} | a.cc:1:9: fatal error: bits\stdc++.h: No such file or directory
1 | #include<bits\stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s878184405 | p03844 | C | #include <bits/stdc++.h>
using namespace std;
int main(){
int a,b;
char op;
scanf("%d%c%d",&a,&op,&b);
if(op=='+')
printf("%d",(a+b));
else if(op=='-')
printf("%d",(a-b));
return 0; | main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
1 | #include <bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s810777346 | p03844 | C++ | #include<bits\stdc++.h>
using namespace std;
int main(){
int a;
int b;
char x;
cin>>a>>x>>b;
switch(x){
case '-':
cout<<a-b;
break;
case '+':
cout<<a+b;
break;
}
return 0;
} | a.cc:1:9: fatal error: bits\stdc++.h: No such file or directory
1 | #include<bits\stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s756166636 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int a,b;
char op;
scanf("%d%c%d",&a,&op,&b);
if(op=='+')
printf("%d",(a+b));
else if(op=='-')
printf("%d",(a-b));
return 0; | a.cc: In function 'int main()':
a.cc:11:10: error: expected '}' at end of input
11 | return 0;
| ^
a.cc:3:11: note: to match this '{'
3 | int main(){
| ^
|
s155482743 | p03844 | C++ | #include<iostream>
using namespace std;
int main( ){
int a,b;
char op;
cin>>a>>op>>b;
if(op=='+'){
cout<<a+b; }
if(op=='-'){
cout<<a-b;
}
return 0; } | a.cc:12:12: error: extended character is not valid in an identifier
12 | return 0; }
| ^
a.cc:12:12: error: '\U0000200f' does not name a type
12 | return 0; }
|
|
s444097291 | p03844 | C++ | #include<iostream>
using namespace std;
int main(){
int a;
char op;
int b;
cin>>a>>op>>b;
if(op=='+'){
cout<<a+b; }
if(op=='-'){
cout<<a-b;
}
return 0; } | a.cc:13:12: error: extended character is not valid in an identifier
13 | return 0; }
| ^
a.cc:13:12: error: '\U0000200f' does not name a type
13 | return 0; }
|
|
s673057362 | p03844 | C++ | #include<iostream>
using namespace std;
int main(){
int a,b;
char op;
cin>>a>>op>>b;
if(op=='+'){
cout<<a+b; }
if(op=='-'){
cout<<a-b;
}
} | a.cc:12:2: error: extended character is not valid in an identifier
12 | }
| ^
a.cc:12:2: error: '\U0000200f' does not name a type
12 | }
|
|
s015347452 | p03844 | C++ | #include<bits\stdc++.h>
using namespace std;
int main(){
int a;
int b;
char op;
cin>>a>>op>>b;
if(op=='-')
cout<<a-b;
else if(op=='+')
cout<<a+b;
return 0;
} | a.cc:1:9: fatal error: bits\stdc++.h: No such file or directory
1 | #include<bits\stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s786014562 | p03844 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
int a,b,x;
char s;
cin>>a>>s>>b;
if(s==43)
{
x=a+b;
cout<<x;}
else
{x=a-b;
cout<<x;
}
} | a.cc:9:1: error: extended character is not valid in an identifier
9 | {
| ^
a.cc:13:1: error: extended character is not valid in an identifier
13 | {x=a-b;
| ^
a.cc: In function 'int main()':
a.cc:9:1: error: '\U000000a0' was not declared in this scope
9 | {
| ^
a.cc:13:1: error: '\U000000a0' was not declared in this scope
13 | {x=a-b;
| ^
|
s094374807 | p03844 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
int a,b,x;
char s;
cin>>a>>s>>b;
if(s=='+')
{
x=a+b;
cout<<x;}
else
{x=a-b;
cout<<x;
}
} | a.cc:9:1: error: extended character is not valid in an identifier
9 | {
| ^
a.cc:13:1: error: extended character is not valid in an identifier
13 | {x=a-b;
| ^
a.cc: In function 'int main()':
a.cc:9:1: error: '\U000000a0' was not declared in this scope
9 | {
| ^
a.cc:13:1: error: '\U000000a0' was not declared in this scope
13 | {x=a-b;
| ^
|
s906509947 | p03844 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int a,b,r;
string op;
scanf("%d%s%d",&a ,&op, &b);
r=aopb;
printf("%d");}
| a.cc: In function 'int main()':
a.cc:7:3: error: 'aopb' was not declared in this scope; did you mean 'op'?
7 | r=aopb;
| ^~~~
| op
|
s586393015 | p03844 | C++ | #include<iostream>
using namespace std;
int main(){
int a,b;
char op;
cin>>a>>op>>b;
if(op=='+'){
cout<<a+b; }
if(op=='-'){
cout<<a-b;
}
return 0; } | a.cc:12:12: error: extended character is not valid in an identifier
12 | return 0; }
| ^
a.cc:12:12: error: '\U0000200f' does not name a type
12 | return 0; }
|
|
s206568522 | p03844 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int a,b;
char op; cin>>a>>op>>b;
if(op=='+'){
cout<<a+b; }
if(op=='-'){
cout<<a-b;
}
return 0; } | a.cc:11:12: error: extended character is not valid in an identifier
11 | return 0; }
| ^
a.cc:11:12: error: '\U0000200f' does not name a type
11 | return 0; }
|
|
s154103835 | p03844 | C | #include <iostream>
using namespace std;
int main()
{
long long a,b,x ,i=0;
cin >> a>>b>>x;
i=(b/x)-(a-1)/x;
if (a<=b&&a==0)
cout << i<<endl;
return 0;
} | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s242743573 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int A,B;
string op;
cin>>A>>op>>p;
if(op=="+")
{
cout<<A+B;
}
else{
cout<<A-B;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:6:13: error: 'p' was not declared in this scope; did you mean 'op'?
6 | cin>>A>>op>>p;
| ^
| op
|
s870232765 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std ;
int main() {
int a,b;
char c;
cin>>a>>b>>c;
switch(c){
case'+':
cout<<a+b;
break;
default;
cout<<a-b;
break;}
return 0;
} | a.cc: In function 'int main()':
a.cc:12:8: error: expected ':' before ';' token
12 | default;
| ^
| :
|
s499303453 | p03844 | C++ | #include<bits\stdc++.h>
using namespace std;
int main(){
int a;
int b;
char x;
cin>>a>>x>>b;
// scanf("%d%c%d",&a,&x,&b);
switch(x){
case '-':
cout<<a-b;
break;
case '+':
cout<<a+b;
break;
}
return 0;
} | a.cc:1:9: fatal error: bits\stdc++.h: No such file or directory
1 | #include<bits\stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s639597331 | p03844 | C++ | #include<bits\stdc++.h>
using namespace std;
int main(){
int a;
int b;
char x;
cin>>a>>x>>b;
// scanf("%d%c%d",&a,&x,&b);
switch(x){
case '-':
cout<<a-b;
break;
case '+':
cout<<a+b;
break;
}
return 0;
} | a.cc:1:9: fatal error: bits\stdc++.h: No such file or directory
1 | #include<bits\stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s187252703 | p03844 | C++ | #include<iostream>
using namespace std;
int main(){
int a,b;
char op;
cin>>a>>op>>b;
if(op=='+'){
cout<<a+b; }
if(op=='-'){
cout<<a-b;
}
return 0; | a.cc: In function 'int main()':
a.cc:12:10: error: expected '}' at end of input
12 | return 0;
| ^
a.cc:3:11: note: to match this '{'
3 | int main(){
| ^
|
s803125764 | p03844 | C++ | #Include<bits/stdc++.h> using namespace std; int main(){ int a,b; char op; cin>>a>>op>>b; if(op=='+'){ cout<<a+b; } if(op=='-'){ cout<<a-b; } return 0; } | a.cc:1:2: error: invalid preprocessing directive #Include; did you mean #include?
1 | #Include<bits/stdc++.h> using namespace std; int main(){ int a,b; char op; cin>>a>>op>>b; if(op=='+'){ cout<<a+b; } if(op=='-'){ cout<<a-b; } return 0; }
| ^~~~~~~
| include
a.cc:1:228: error: extended character is not valid in an identifier
1 | #Include<bits/stdc++.h> using namespace std; int main(){ int a,b; char op; cin>>a>>op>>b; if(op=='+'){ cout<<a+b; } if(op=='-'){ cout<<a-b; } return 0; }
| ^
|
s929062346 | p03844 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int a,b;
char op;
cin>>a>>op>>b;
if(op=='+'){
cout<<a+b; }
if(op=='-'){
cout<<a-b;
}
return 0;
}
| a.cc:13:2: error: extended character is not valid in an identifier
13 | }
| ^
a.cc:13:2: error: '\U0000200f' does not name a type
13 | }
|
|
s386971642 | p03844 | C++ | include<bits/stdc++.h>
using namespace std;
int main(){
int a,b;
char op; cin>>a>>op>>b;
if(op=='+'){
cout<<a+b; }
if(op=='-'){
cout<<a-b;
}
return 0; }
| a.cc:11:12: error: extended character is not valid in an identifier
11 | return 0; }
| ^
a.cc:1:1: error: 'include' does not name a type
1 | include<bits/stdc++.h>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:5:16: error: 'cin' was not declared in this scope
5 | char op; cin>>a>>op>>b;
| ^~~
a.cc:7:9: error: 'cout' was not declared in this scope
7 | cout<<a+b; }
| ^~~~
a.cc:9:1: error: 'cout' was not declared in this scope
9 | cout<<a-b;
| ^~~~
a.cc: At global scope:
a.cc:11:12: error: '\U0000200f' does not name a type
11 | return 0; }
|
|
s387363925 | p03844 | C | #include<stdio.h>
#include<stdlib.h>
int main(){
int s,b;
char op;
scanf("%d%c%d",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:6:18: error: 'a' undeclared (first use in this function)
6 | scanf("%d%c%d",a,op,b);
| ^
main.c:6:18: note: each undeclared identifier is reported only once for each function it appears in
|
s144320512 | p03844 | C | #include <iostream>
#include <stdio.h>
using namespace std;
int main() {
int x ,y;
char c;
cin >> x;
cin >> c;
cin >> y;
switch (c) {
case '+':
cout << x + y;
break;
case '-':
cout << x - y;
break;
}
} | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s940609985 | p03844 | C++ | #include <bits/stdc++.h>
#include <stdio.h>
using namespace std;
int main(){
long long a,b,r;
char c;
scanf("%lld%lld%c",&a,&c,&b);
if (c=='+')
cout <<a+b;
else if c=='-')
cout <<a-b;
return 0;
}
| a.cc: In function 'int main()':
a.cc:10:9: error: expected '(' before 'c'
10 | else if c=='-')
| ^
| (
|
s561844709 | p03844 | C++ | #include<bits/stdc++.h>
using namespace std ;
int main (){
int A,B;
char op;
scanf("%d ",&A);
scanf("%c ",&op);
scanf("%d",&B);
if(op=='+')
printf("%d",A+B);
else
printf("%d",A-B);
| a.cc: In function 'int main()':
a.cc:12:18: error: expected '}' at end of input
12 | printf("%d",A-B);
| ^
a.cc:3:12: note: to match this '{'
3 | int main (){
| ^
|
s339262505 | p03844 | C | #include <bits/stdc++.h>
using namespace std;
int main() {
int a,b,sum=0;
char x;
cin>>a>>x>>b;
if(x=='+'){
sum=a+b;
} else if(x=='-'){
sum=a-b;
}else{
printf("wrong op");
}
printf("%d",sum);
return 0;
}
| main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
1 | #include <bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s358275883 | p03844 | C++ | #include<iostream>
using namespace std;
int main(){
int A,B;
char x;
cin>>A;
cin>>s;
cin>>B;
if(x=='+'){
cout<<A+B<<endl;
}
else{
cout<<A-B<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:7:14: error: 's' was not declared in this scope
7 | cin>>s;
| ^
|
s508713530 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int A;
string B;
int C;
cin>>A>>B>>C;
if(B=="+"){
cout<<A+B<<endl;
}
else{
cout<<A-B<<endl;
}
}
| a.cc: In function 'int main()':
a.cc:9:8: error: no match for 'operator+' (operand types are 'int' and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
9 | cout<<A+B<<endl;
| ~^~
| | |
| | std::string {aka std::__cxx11::basic_string<char>}
| int
In file included from /usr/include/c++/14/bits/stl_algobase.h:67,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_iterator.h:627:5: note: candidate: 'template<class _Iterator> constexpr std::reverse_iterator<_Iterator> std::operator+(typename reverse_iterator<_Iterator>::difference_type, const reverse_iterator<_Iterator>&)'
627 | operator+(typename reverse_iterator<_Iterator>::difference_type __n,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:627:5: note: template argument deduction/substitution failed:
a.cc:9:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
9 | cout<<A+B<<endl;
| ^
/usr/include/c++/14/bits/stl_iterator.h:1798:5: note: candidate: 'template<class _Iterator> constexpr std::move_iterator<_IteratorL> std::operator+(typename move_iterator<_IteratorL>::difference_type, const move_iterator<_IteratorL>&)'
1798 | operator+(typename move_iterator<_Iterator>::difference_type __n,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1798:5: note: template argument deduction/substitution failed:
a.cc:9:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
9 | cout<<A+B<<endl;
| ^
In file included 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/bits/basic_string.h:3598:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3598 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3598:5: note: template argument deduction/substitution failed:
a.cc:9:9: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
9 | cout<<A+B<<endl;
| ^
/usr/include/c++/14/bits/basic_string.h:3616:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3616 | operator+(const _CharT* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3616:5: note: template argument deduction/substitution failed:
a.cc:9:9: note: mismatched types 'const _CharT*' and 'int'
9 | cout<<A+B<<endl;
| ^
/usr/include/c++/14/bits/basic_string.h:3635:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3635 | operator+(_CharT __lhs, const basic_string<_CharT,_Traits,_Alloc>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3635:5: note: template argument deduction/substitution failed:
a.cc:9:9: note: deduced conflicting types for parameter '_CharT' ('int' and 'char')
9 | cout<<A+B<<endl;
| ^
/usr/include/c++/14/bits/basic_string.h:3652:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)'
3652 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3652:5: note: template argument deduction/substitution failed:
a.cc:9:9: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
9 | cout<<A+B<<endl;
| ^
/usr/include/c++/14/bits/basic_string.h:3670:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, _CharT)'
3670 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, _CharT __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3670:5: note: template argument deduction/substitution failed:
a.cc:9:9: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
9 | cout<<A+B<<endl;
| ^
/usr/include/c++/14/bits/basic_string.h:3682:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3682 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3682:5: note: template argument deduction/substitution failed:
a.cc:9:9: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
9 | cout<<A+B<<endl;
| ^
/usr/include/c++/14/bits/basic_string.h:3689:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)'
3689 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3689:5: note: template argument deduction/substitution failed:
a.cc:9:9: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
9 | cout<<A+B<<endl;
| ^
/usr/include/c++/14/bits/basic_string.h:3696:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)'
3696 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3696:5: note: template argument deduction/substitution failed:
a.cc:9:9: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
9 | cout<<A+B<<endl;
| ^
/usr/include/c++/14/bits/basic_string.h:3719:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)'
3719 | operator+(const _CharT* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3719:5: note: template argument deduction/substitution failed:
a.cc:9:9: note: mismatched types 'const _CharT*' and 'int'
9 | cout<<A+B<<endl;
| ^
/usr/include/c++/14/bits/basic_string.h:3726:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)'
3726 | operator+(_CharT __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3726:5: note: template argument deduction/substitution failed:
a.cc:9:9: note: deduced conflicting types for parameter '_CharT' ('int' and 'char')
9 | cout<<A+B<<endl;
| ^
/usr/include/c++/14/bits/basic_string.h:3733:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const _CharT*)'
3733 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3733:5: note: template argument deduction/substitution failed:
a.cc:9:9: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
9 | cout<<A+B<<endl;
| ^
/usr/include/c++/14/bits/basic_string.h:3740:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, _CharT)'
3740 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3740:5: note: template argument deduction/substitution failed:
a.cc:9:9: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
9 | cout<<A+B<<endl;
| ^
In file included from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/complex:340:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator+(const complex<_Tp>&, const complex<_Tp>&)'
340 | operator+(const complex<_Tp>& __x, const complex<_Tp>& __y)
| ^~~~~~~~
/usr/include/c++/14/complex:340:5: note: template argument deduction/substitution failed:
a.cc:9:9: note: mismatched types 'const std::complex<_Tp>' and 'int'
9 | cout<<A+B<<endl;
| ^
/usr/include/c++/14/complex:349:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator+(const complex<_Tp>&, const _Tp&)'
349 | operator+(const complex<_Tp>& __x, const _Tp& __y)
| ^~~~~~~~
/usr/include/c++/14/complex:349:5: note: template argument deduction/substitution failed:
a.cc:9:9: note: mismatched types 'const std::complex<_Tp>' and 'int'
9 | cout<<A+B<<endl;
| ^
/usr/include/c++/14/complex:358:5: |
s818472308 | 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;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:9:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
9 | if(op == "+"){
| ~~~^~~~~~
|
s866610755 | 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;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:9:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
9 | if (op == "+"){
| ~~~^~~~~~
|
s071584028 | p03844 | C++ | #include <iostream>
using namespace std;
int main() {
int A, op, B;
cin >> A >> op >> B ;
cout << (A op B) << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:8:15: error: expected ')' before 'op'
8 | cout << (A op B) << endl;
| ~ ^~~
| )
|
s667140782 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int A ,O,B;
cin>>A>>O>>B;
cout <<AOB;
}
| a.cc: In function 'int main()':
a.cc:7:10: error: 'AOB' was not declared in this scope
7 | cout <<AOB;
| ^~~
|
s620049311 | p03844 | C | #include <iostream>
using namespace std;
int main() {
int a,b;
char op;
cin>>a >>op >> b;
if(op=='+')
{
cout<< a+b;
}
else
{
cout << a-b;
}
return 0;
}
| main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s055199284 | p03844 | Java | // 2019/07/08
// AtCoder Beginner Contest 050 - A
import java.util.*;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
// Input
int a = sc.nextInt();
int o = sc.next();
int b = sc.nextInt();
int ans;
// Check
if(o.equals("+")){
ans = a + b;
} else {
ans = a - b;
}
// Output
System.out.println(ans);
}
} | Main.java:10: error: incompatible types: String cannot be converted to int
int o = sc.next();
^
Main.java:15: error: int cannot be dereferenced
if(o.equals("+")){
^
2 errors
|
s670291875 | p03844 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int A ,B; char C;
cin>>A>>C>>B;
if(C=='+') int D = A+B;
else int D = A-B;
cout<<D<<endl;
} | a.cc: In function 'int main()':
a.cc:8:9: error: 'D' was not declared in this scope
8 | cout<<D<<endl;
| ^
|
s074530868 | p03844 | C++ | #include<iostream>
#include<vector>
#include<string>
#include<cstring>
#include<algorithm>
#include<map>
#include<set>
#include<cmath>
#include<cassert>
#include<queue>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
int main() {
ll A, B;
char op;
cin >> A >> op >> B;
if (op == "+") cout << A+B << endl;
else cout << A-B << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:20:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
20 | if (op == "+") cout << A+B << endl;
| ~~~^~~~~~
|
s341501691 | p03844 | C++ | #include<iostream>
using namespace std;
int main(){
int a,b;
char x;
cin >> a >> x >> b;
if(x==+)
cout << a+b;
else
cout << a-b;
}
| a.cc: In function 'int main()':
a.cc:8:10: error: expected primary-expression before ')' token
8 | if(x==+)
| ^
|
s510783307 | p03844 | C++ | #include <bits/stdc++.h>
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:5:3: error: 'string' was not declared in this scope
5 | string op;
| ^~~~~~
a.cc:5:3: note: suggested alternatives:
In file included from /usr/include/c++/14/string:41,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note: 'std::string'
77 | typedef basic_string<char> string;
| ^~~~~~
/usr/include/c++/14/string:76:11: note: 'std::pmr::string'
76 | using string = basic_string<char>;
| ^~~~~~
a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
6 | cin >> A >> op >> B;
| ^~~
| std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:6:15: error: 'op' was not declared in this scope
6 | cin >> A >> op >> B;
| ^~
a.cc:8:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
8 | cout << A+B << endl;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:8:20: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
8 | cout << A+B << endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/istream:41,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
a.cc:11:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
11 | 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:11:20: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
11 | 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)
| ^~~~
|
s812942034 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int A,B,X;
char OP;
cin >> A >> OP >> B;
if(OP=="+"){
X = A + B;
}
if(OP=="-"){
X = A- B;
}
cout << X <<endl;
}
| a.cc: In function 'int main()':
a.cc:9:6: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
9 | if(OP=="+"){
| ~~^~~~~
a.cc:12:6: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
12 | if(OP=="-"){
| ~~^~~~~
|
s360611868 | p03844 | C++ | #include <bits/stdc++.h>
int main()
{
int a,b;
char op;
cin>>a>>op>>b;
if(op=='-')
a-=b;
else
a+=b;
cout<<a<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:7:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
7 | cin>>a>>op>>b;
| ^~~
| std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:12:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
12 | cout<<a<<endl;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:12:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
12 | cout<<a<<endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/istream:41,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s995927501 | p03844 | C++ | #include <iostream>
int main(){
int a, b;
char op;
cin >> a >> op >> b;
if( op=='+' ) cout << a+b << endl;
if( op=='-' ) cout<< a-b << endl;
} | a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
7 | cin >> a >> op >> 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:9:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
9 | if( op=='+' ) 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:9:32: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
9 | if( op=='+' ) cout << a+b << endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
a.cc:10:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
10 | if( op=='-' ) 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:31: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
10 | if( op=='-' ) 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)
| ^~~~
|
s912423438 | p03844 | C++ | #include <iostream>
using namespace std;
int main(void) {
(double)int A, B;
string op;
if (A < B) {
if (op == "+") {
cout << A+B << endl;
} else {
cout << "-" << B-A << endl;
} else {
if (op == "+") {
cout << A+B << endl;
} else {
cout << A-B << endl;
} | a.cc: In function 'int main()':
a.cc:6:11: error: expected primary-expression before 'int'
6 | (double)int A, B;
| ^~~
a.cc:9:7: error: 'A' was not declared in this scope
9 | if (A < B) {
| ^
a.cc:9:11: error: 'B' was not declared in this scope
9 | if (A < B) {
| ^
a.cc:14:5: error: expected '}' before 'else'
14 | } else {
| ^~~~
a.cc:9:14: note: to match this '{'
9 | if (A < B) {
| ^
a.cc:19:2: error: expected '}' at end of input
19 | }
| ^
a.cc:14:10: note: to match this '{'
14 | } else {
| ^
a.cc:19:2: error: expected '}' at end of input
19 | }
| ^
a.cc:5:16: note: to match this '{'
5 | int main(void) {
| ^
|
s009784953 | p03844 | C++ | #include <iostream>
using namespace std;
int main(void) {
int(double) A, B;
string op;
if (A < B) {
if (op == "+") {
cout << A+B << endl;
} else {
cout << "-" << B-A << endl;
} else {
if (op == "+") {
cout << A+B << endl;
} else {
cout << A-B << endl;
} | a.cc: In function 'int main()':
a.cc:6:3: error: expected primary-expression before 'int'
6 | int(double) A, B;
| ^~~
a.cc:9:7: error: 'A' was not declared in this scope
9 | if (A < B) {
| ^
a.cc:9:11: error: 'B' was not declared in this scope
9 | if (A < B) {
| ^
a.cc:14:5: error: expected '}' before 'else'
14 | } else {
| ^~~~
a.cc:9:14: note: to match this '{'
9 | if (A < B) {
| ^
a.cc:19:2: error: expected '}' at end of input
19 | }
| ^
a.cc:14:10: note: to match this '{'
14 | } else {
| ^
a.cc:19:2: error: expected '}' at end of input
19 | }
| ^
a.cc:5:16: note: to match this '{'
5 | int main(void) {
| ^
|
s357668847 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main () {
int A, B;
char op;
cin >> A >> op >> B;
if(op == +) {
cout << A + B << endl;
}
else {
cout << A - B << endl;
}
} | a.cc: In function 'int main()':
a.cc:9:13: error: expected primary-expression before ')' token
9 | if(op == +) {
| ^
|
s864499583 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main () {
int A, B;
char op;
cin >> A >> op >> B;
cout << A op B << endl;
} | a.cc: In function 'int main()':
a.cc:9:12: error: expected ';' before 'op'
9 | cout << A op B << endl;
| ^~~
| ;
|
s795172073 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main () {
int A, B;
string op;
cin >> A >> op >> B;
if(op == +) {
cout << A + B << endl;
}
else {
cout << A - B << endl;
}
} | a.cc: In function 'int main()':
a.cc:9:13: error: expected primary-expression before ')' token
9 | if(op == +) {
| ^
|
s208862580 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main () {
int A, B;
string op;
cin >> A >> op >> B;
cout << A op B << endl;
} | a.cc: In function 'int main()':
a.cc:9:12: error: expected ';' before 'op'
9 | cout << A op B << endl;
| ^~~
| ;
|
s976531003 | 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:13: error: expected primary-expression before ')' token
9 | if(op == +){
| ^
|
s252910097 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main () {
int A, B;
string op;
cout << A op B << endl;
} | a.cc: In function 'int main()':
a.cc:8:12: error: expected ';' before 'op'
8 | cout << A op B << endl;
| ^~~
| ;
|
s120989175 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int a,c;
string s;
cin >>a>>s>>c;
if(s=='+')
cout<<a+c;
if(s=='-')
cout<<a-c;
} | a.cc: In function 'int main()':
a.cc:7:7: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
7 | if(s=='+')
| ~^~~~~
| | |
| | char
| std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/regex:68,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181,
from a.cc:1:
/usr/include/c++/14/bits/regex.h:1103:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const sub_match<_BiIter>&)'
1103 | operator==(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1103:5: note: template argument deduction/substitution failed:
a.cc:7:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
7 | if(s=='+')
| ^~~
/usr/include/c++/14/bits/regex.h:1199:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator==(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)'
1199 | operator==(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1199:5: note: template argument deduction/substitution failed:
a.cc:7:9: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char'
7 | if(s=='+')
| ^~~
/usr/include/c++/14/bits/regex.h:1274:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator==(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)'
1274 | operator==(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1274:5: note: template argument deduction/substitution failed:
a.cc:7:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
7 | if(s=='+')
| ^~~
/usr/include/c++/14/bits/regex.h:1366:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)'
1366 | operator==(typename iterator_traits<_Bi_iter>::value_type const* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1366:5: note: template argument deduction/substitution failed:
a.cc:7:9: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char'
7 | if(s=='+')
| ^~~
/usr/include/c++/14/bits/regex.h:1441:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)'
1441 | operator==(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1441:5: note: template argument deduction/substitution failed:
a.cc:7:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
7 | if(s=='+')
| ^~~
/usr/include/c++/14/bits/regex.h:1534:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)'
1534 | operator==(typename iterator_traits<_Bi_iter>::value_type const& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1534:5: note: template argument deduction/substitution failed:
a.cc:7:9: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char'
7 | if(s=='+')
| ^~~
/usr/include/c++/14/bits/regex.h:1613:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)'
1613 | operator==(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1613:5: note: template argument deduction/substitution failed:
a.cc:7:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
7 | if(s=='+')
| ^~~
/usr/include/c++/14/bits/regex.h:2186:5: note: candidate: 'template<class _Bi_iter, class _Alloc> bool std::__cxx11::operator==(const match_results<_BiIter, _Alloc>&, const match_results<_BiIter, _Alloc>&)'
2186 | operator==(const match_results<_Bi_iter, _Alloc>& __m1,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:2186:5: note: template argument deduction/substitution failed:
a.cc:7:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::match_results<_BiIter, _Alloc>'
7 | if(s=='+')
| ^~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/bits/stl_pair.h:1033:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator==(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1033 | operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1033:5: note: template argument deduction/substitution failed:
a.cc:7:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>'
7 | if(s=='+')
| ^~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:67:
/usr/include/c++/14/bits/stl_iterator.h:441:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
441 | operator==(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:441:5: note: template argument deduction/substitution failed:
a.cc:7:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
7 | if(s=='+')
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:486:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
486 | operator==(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:486:5: note: template argument deduction/substitution failed:
a.cc:7:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
7 | if(s=='+')
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:1667:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1667 | operator==(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1667:5: note: template argument deduction/substitution failed:
a.cc:7:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
7 | if(s=='+')
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:1737:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1737 | operator==(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1737:5: note: template argument deduction/substitution failed:
a.cc:7:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
7 | if(s=='+')
| ^~~
In file included from /usr/include/c++/14/bits/char_traits.h:42,
from /usr/include/c++/14/string:42,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/bits/postypes.h:192:5: note: candidate: 'template<class _StateT> bool std::operator==(const fpos<_StateT>&, const fpos<_StateT>&)'
192 | operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/postypes.h:192:5: note: template argument deduction/substitution failed:
a.cc:7:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::fpos<_StateT>'
7 | if(s=='+')
| ^~~
In file included from /usr/include/c++/14/string:43:
/usr/include/c++/14/bits/allocator.h:235:5: note: candidate: 'template<class _T1, class _T2> bool std::operator==(const allocator<_CharT>&, const allocator<_T2>&)'
235 | operator==(const allocator<_T1>&, const allocator<_T2>&)
| ^~~~~~~~
/usr/include/c++/14/bits/allocator.h:235:5: note: template argument deduction/substitution failed:
a.cc:7:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::allocator<_CharT>'
7 | if(s=='+')
| ^~~
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54:
/usr/include/c++/14/string_view:629:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator==(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)'
629 | operator==(basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:629:5: note: template argument deduction/substitution failed:
a.cc:7:9: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
7 | if(s=='+')
| ^~~
/usr/include/c++/14/string_view:637:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator==(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)'
637 | operator==(basic_string_view<_CharT, _Traits> __x,
| |
s420742267 | p03844 | C++ | #include <iostream>
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <array>
#include <cfloat>
using namespace std;
int main (){
int a,c;
char b;
cin >> a >> b >> c;
if(b=="+"){
cout << a + c;
}else{
cout << a - c;
}
} | a.cc: In function 'int main()':
a.cc:12:5: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
12 | if(b=="+"){
| ~^~~~~
|
s983917332 | p03844 | C++ | #include <iostream>
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <array>
#include <cfloat>
using namespace std;
int main (){
int a,c;
char b;
cin >> a >> b >> c;
if(b=="+"){
cout << a + c;
}
cout << "vowel";
}else{
cout << a - c;
}
} | a.cc: In function 'int main()':
a.cc:12:5: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
12 | if(b=="+"){
| ~^~~~~
a.cc: At global scope:
a.cc:16:2: error: expected unqualified-id before 'else'
16 | }else{
| ^~~~
a.cc:19:1: error: expected declaration before '}' token
19 | }
| ^
|
s783062290 | p03844 | C++ | #include <iostream>
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <array>
#include <cfloat>
using namespace std;
int main (){
char a,b,c;
cin >> c;
if(b=="+"){
cout << a + c;
}
cout << "vowel";
}else{
cout << a - c;
}
} | a.cc: In function 'int main()':
a.cc:11:5: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
11 | if(b=="+"){
| ~^~~~~
a.cc: At global scope:
a.cc:15:2: error: expected unqualified-id before 'else'
15 | }else{
| ^~~~
a.cc:18:1: error: expected declaration before '}' token
18 | }
| ^
|
s839115133 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int A, B;
string op;
cin >> A >> B ;
cin >> op ;
if (op == '+'){
cout << A + B << endl;
}
else if(op == '-'){
cout << A - B << endl;
}
}
| a.cc: In function 'int main()':
a.cc:10:11: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
10 | if (op == '+'){
| ~~ ^~ ~~~
| | |
| | char
| std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/regex:68,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181,
from a.cc:1:
/usr/include/c++/14/bits/regex.h:1103:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const sub_match<_BiIter>&)'
1103 | operator==(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1103:5: note: template argument deduction/substitution failed:
a.cc:10:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
10 | if (op == '+'){
| ^~~
/usr/include/c++/14/bits/regex.h:1199:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator==(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)'
1199 | operator==(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1199:5: note: template argument deduction/substitution failed:
a.cc:10:14: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char'
10 | if (op == '+'){
| ^~~
/usr/include/c++/14/bits/regex.h:1274:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator==(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)'
1274 | operator==(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1274:5: note: template argument deduction/substitution failed:
a.cc:10:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
10 | if (op == '+'){
| ^~~
/usr/include/c++/14/bits/regex.h:1366:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)'
1366 | operator==(typename iterator_traits<_Bi_iter>::value_type const* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1366:5: note: template argument deduction/substitution failed:
a.cc:10:14: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char'
10 | if (op == '+'){
| ^~~
/usr/include/c++/14/bits/regex.h:1441:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)'
1441 | operator==(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1441:5: note: template argument deduction/substitution failed:
a.cc:10:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
10 | if (op == '+'){
| ^~~
/usr/include/c++/14/bits/regex.h:1534:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)'
1534 | operator==(typename iterator_traits<_Bi_iter>::value_type const& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1534:5: note: template argument deduction/substitution failed:
a.cc:10:14: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char'
10 | if (op == '+'){
| ^~~
/usr/include/c++/14/bits/regex.h:1613:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)'
1613 | operator==(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1613:5: note: template argument deduction/substitution failed:
a.cc:10:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
10 | if (op == '+'){
| ^~~
/usr/include/c++/14/bits/regex.h:2186:5: note: candidate: 'template<class _Bi_iter, class _Alloc> bool std::__cxx11::operator==(const match_results<_BiIter, _Alloc>&, const match_results<_BiIter, _Alloc>&)'
2186 | operator==(const match_results<_Bi_iter, _Alloc>& __m1,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:2186:5: note: template argument deduction/substitution failed:
a.cc:10:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::match_results<_BiIter, _Alloc>'
10 | if (op == '+'){
| ^~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/bits/stl_pair.h:1033:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator==(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1033 | operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1033:5: note: template argument deduction/substitution failed:
a.cc:10:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>'
10 | if (op == '+'){
| ^~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:67:
/usr/include/c++/14/bits/stl_iterator.h:441:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
441 | operator==(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:441:5: note: template argument deduction/substitution failed:
a.cc:10:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
10 | if (op == '+'){
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:486:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
486 | operator==(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:486:5: note: template argument deduction/substitution failed:
a.cc:10:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
10 | if (op == '+'){
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:1667:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1667 | operator==(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1667:5: note: template argument deduction/substitution failed:
a.cc:10:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
10 | if (op == '+'){
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:1737:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1737 | operator==(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1737:5: note: template argument deduction/substitution failed:
a.cc:10:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
10 | if (op == '+'){
| ^~~
In file included from /usr/include/c++/14/bits/char_traits.h:42,
from /usr/include/c++/14/string:42,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/bits/postypes.h:192:5: note: candidate: 'template<class _StateT> bool std::operator==(const fpos<_StateT>&, const fpos<_StateT>&)'
192 | operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/postypes.h:192:5: note: template argument deduction/substitution failed:
a.cc:10:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::fpos<_StateT>'
10 | if (op == '+'){
| ^~~
In file included from /usr/include/c++/14/string:43:
/usr/include/c++/14/bits/allocator.h:235:5: note: candidate: 'template<class _T1, class _T2> bool std::operator==(const allocator<_CharT>&, const allocator<_T2>&)'
235 | operator==(const allocator<_T1>&, const allocator<_T2>&)
| ^~~~~~~~
/usr/include/c++/14/bits/allocator.h:235:5: note: template argument deduction/substitution failed:
a.cc:10:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::allocator<_CharT>'
10 | if (op == '+'){
| ^~~
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54:
/usr/include/c++/14/string_view:629:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator==(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)'
629 | operator==(basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:629:5: note: template argument deduction/substitution failed:
a.cc:10:14: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
10 | if (op == '+'){
| ^~~
/usr/include/c++/14/string_view:637:5: |
s373503788 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int A, B;
char op;
cin >> A >> B ;
cin >> op ;
if (op == '+'){
cout << A op B <<endl;
}
else if(op == '-'){
cout << A op B << endl;
}
}
| a.cc: In function 'int main()':
a.cc:11:15: error: expected ';' before 'op'
11 | cout << A op B <<endl;
| ^~~
| ;
a.cc:15:12: error: expected ';' before 'op'
15 | cout << A op B << endl;
| ^~~
| ;
|
s141093462 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int A
char op
int B;
cin >> A >> B ;
cin >> op ;
if (op == '+'){
cout << A + B <<endl;
}
else if(op == '-'){
cout << A - B << endl;
}
}
| a.cc: In function 'int main()':
a.cc:6:3: error: expected initializer before 'char'
6 | char op
| ^~~~
a.cc:9:9: error: 'A' was not declared in this scope
9 | cin >> A >> B ;
| ^
a.cc:9:14: error: 'B' was not declared in this scope
9 | cin >> A >> B ;
| ^
a.cc:10:10: error: 'op' was not declared in this scope
10 | cin >> op ;
| ^~
|
s401616445 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int A, B;
string op;
cin >> A >> op >> B ;
if (op == '+'){
cout << A + B <<endl;
}
else{
cout << A - B << endl;
}
}
| a.cc: In function 'int main()':
a.cc:9:11: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
9 | if (op == '+'){
| ~~ ^~ ~~~
| | |
| | char
| std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/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 == '+'){
| ^~~
/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 == '+'){
| ^~~
/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 == '+'){
| ^~~
/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 == '+'){
| ^~~
/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 == '+'){
| ^~~
/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 == '+'){
| ^~~
/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 == '+'){
| ^~~
/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 == '+'){
| ^~~
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 == '+'){
| ^~~
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 == '+'){
| ^~~
/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 == '+'){
| ^~~
/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 == '+'){
| ^~~
/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 == '+'){
| ^~~
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 == '+'){
| ^~~
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 == '+'){
| ^~~
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54:
/usr/include/c++/14/string_view:629:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator==(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)'
629 | operator==(basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:629:5: note: template argument deduction/substitution failed:
a.cc:9:14: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
9 | if (op == '+'){
| ^~~
/usr/include/c++/14/string_view:637:5: note: candidate: |
s346019075 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int A, B;
string op;
cin >> A >> op >> B ;
if (op == +){
cout << A + B <<endl;
}
else{
cout << A - B << endl;
}
}
| a.cc: In function 'int main()':
a.cc:9:15: error: expected primary-expression before ')' token
9 | if (op == +){
| ^
|
s413002212 | 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 << endl;
}
}
| a.cc: In function 'int main()':
a.cc:9:15: error: expected primary-expression before ')' token
9 | if (op == +){
| ^
a.cc:11:4: error: expected primary-expression before '}' token
11 | }
| ^
|
s281419321 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int A, B;
string op;
cin >> A >> op >> B ;
cout << A op B << endl;
}
| a.cc: In function 'int main()':
a.cc:10:12: error: expected ';' before 'op'
10 | cout << A op B << endl;
| ^~~
| ;
|
s903308823 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int A, op, B;
cin >> A >> op >> B ;
cout << A op B << endl;
}
}
| a.cc: In function 'int main()':
a.cc:9:12: error: expected ';' before 'op'
9 | cout << A op B << endl;
| ^~~
| ;
a.cc: At global scope:
a.cc:12:1: error: expected declaration before '}' token
12 | }
| ^
|
s261834440 | p03844 | C++ | #include<bits/stdc++.h>
using namespace std
int main(){
int a,b;char c;
cin >> a >> c >> b;
if(c == '+') cout << a+b;
else cout << a-b;
} | a.cc:3:20: error: expected ';' before 'int'
3 | using namespace std
| ^
| ;
......
6 | int main(){
| ~~~
|
s321783570 | p03844 | C++ | #include<stdio.h>
int main(void)
{
int a,b;
char op;
scanf("%d",&a);
scanf("%c",&op);
scanf("%d",&b);
if(op=='+'){
c=a+b;
}
if(op=='-'){
c=a-b;
}
printf("%d\n",&c);
return 0;
} | a.cc: In function 'int main()':
a.cc:10:17: error: 'c' was not declared in this scope
10 | c=a+b;
| ^
a.cc:13:17: error: 'c' was not declared in this scope
13 | c=a-b;
| ^
a.cc:15:24: error: 'c' was not declared in this scope
15 | printf("%d\n",&c);
| ^
|
s876476579 | p03844 | C++ | #include<stdio.h>
int main(void)
{
int a,b;
char op;
scanf("%d",&a);
scanf("%c",&op);
scanf("%d",&b);
if(op=='+'){
c=a+b;
}
if(op=='-'){
c=a-b;
}
printf("%d",&c);
return 0;
} | a.cc: In function 'int main()':
a.cc:10:17: error: 'c' was not declared in this scope
10 | c=a+b;
| ^
a.cc:13:17: error: 'c' was not declared in this scope
13 | c=a-b;
| ^
a.cc:15:22: error: 'c' was not declared in this scope
15 | printf("%d",&c);
| ^
|
s070697280 | p03844 | C++ | #include<stdio.h>
int main(void)
{
int a,b;
char o;
scanf("%d",&a);
scanf("%c",&op);
scanf("%d",&b);
if(op=='+'){
printf("%d",a+b);
}
if(op=='-'){
printf("%d",a-b);
}
return 0;
} | a.cc: In function 'int main()':
a.cc:7:21: error: 'op' was not declared in this scope; did you mean 'o'?
7 | scanf("%c",&op);
| ^~
| o
|
s962702165 | p03844 | C++ | #include <bits/stdc++.h>
#include<algorithm>
#include<math.h>
using namespace std;
template <class T> using V = vector<T>;
using ll = long long;
using db = double;
using st = string;
using ch = char;
using vll = V<ll>;
using vpll =V<pair<ll,ll>>;
using vst = V<st>;
using vdb = V<db>;
using vch = V<ch>;
#define FOR(i,a,b) for(ll i=(a);i<(ll)(b);i++)
#define rFOR(i,a,b) for(ll i=(a);i>(ll)(b);i--)
#define oFOR(i,a,b) for(ll i=(a);i<(ll)(b);i+=2)
#define bgn begin()
#define en end()
#define SORT(a) sort((a).bgn,(a).en)
#define REV(a) reverse((a).bgn,(a).en)
#define M(a,b) max(a,b)
#define rM(a,b) min(a,b)
#define fi first
#define se second
#define sz size()
#define gcd(a,b) __gcd(a,b)
#define co(a) cout<<a<<endl;
#define ci(a) cin>>a;
ll sum(ll n) {
ll m=0;
FOR(i,0,20){
m+=n%10;
n/=10;
if(n==0){
break;
}
}
return m;
}
ll combi(ll n,ll m) {
ll ans=1;
rFOR(i,n,n-m){
ans*=i;
}
FOR(i,1,m+1){
ans/=i;
}
return ans;
}
ll lcm(ll a,ll b){
ll n;
n=a/gcd(a,b)*b;
return n;
}
/****************************************\
| Thank you for viewing my code:) |
| Written by RedSpica a.k.a. RanseMirage |
| Twitter:@asakaakasaka |
\****************************************/
signed main() {
ll a;
ci(a);
ch b;
ci(b);
ll c;
ci(c);
if(b=='+') co(a+b);
else co(a-b)
} | a.cc: In function 'int main()':
a.cc:83:3: error: 'else' without a previous 'if'
83 | else co(a-b)
| ^~~~
|
s215433899 | p03844 | C++ | main = do
n <- words <$> getLine
let l = read $ head n
let op = head $ tail n
let r = read $ last n
putStrLn $ biop op l r
biop :: String -> Int -> Int -> String
biop o l r
| o == "+" = show $ l + r
| o == "-" = show $ subtract r l
| otherwise = undefined | a.cc:1:1: error: 'main' does not name a type
1 | main = do
| ^~~~
|
s738162727 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main (){
int A,B;
char op;
cin>>A>>op>>B;
if(op == '+'){
cout<<A+B<<endl;
}else{
cout<<A-B<<endl;
} | a.cc: In function 'int main()':
a.cc:12:2: error: expected '}' at end of input
12 | }
| ^
a.cc:4:12: note: to match this '{'
4 | int main (){
| ^
|
s918301747 | p03844 | C++ | A,op,B = input().split()
print(int(A)+int(B) if op == "+" else int(A)-int(B)) | a.cc:1:1: error: 'A' does not name a type
1 | A,op,B = input().split()
| ^
|
s914042396 | p03844 | C++ | #include<iostream>
#include<string>
using namespace std;
int main(){
int a,b;string s;cin>>a>>s>>b;
if(s=='+')cout<<a+b;
else cout<<a-b;
} | a.cc: In function 'int main()':
a.cc:6:7: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
6 | if(s=='+')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:6:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::fpos<_StateT>'
6 | if(s=='+')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:6:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::allocator<_CharT>'
6 | if(s=='+')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:6:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
6 | if(s=='+')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:6:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
6 | if(s=='+')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:6:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
6 | if(s=='+')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:6:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
6 | if(s=='+')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:6:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>'
6 | if(s=='+')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:6:9: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
6 | if(s=='+')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:6:9: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
6 | if(s=='+')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:6:9: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'char'
6 | if(s=='+')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:6:9: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'char'
6 | if(s=='+')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:6:9: note: mismatched types 'const _CharT*' and 'char'
6 | if(s=='+')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:6:9: note: mismatched types 'const _CharT*' and 'std::__cxx11::basic_string<char>'
6 | if(s=='+')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:6:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::tuple<_UTypes ...>'
6 | if(s=='+')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:6:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::istreambuf_iterator<_CharT, _Traits>'
6 | if(s=='+')cout<<a+b;
| ^~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/c++allocator.h:33,
from /usr/include/c++/14/bits/allocator.h:46:
/usr/include/c++/14/bits/new_allocator.h:215:9: note: candidate: 'template<class _Up> bool std::operator==(const __new_allocator<char>&, const __new_allocator<_Tp>&)'
215 | operator==(const __new_allocator&, const __new_allocator<_Up>&)
| ^~~~~~~~
/usr/include/c++/14/bits/new_allocator.h:215:9: note |
s908210358 | p03844 | C++ | #include<iostream>
#include<string>
int main(){
int a,b;string s;cin>>a>>s>>b;
if(s=='+')cout<<a+b;
else cout<<a-b;
} | a.cc: In function 'int main()':
a.cc:4:11: error: 'string' was not declared in this scope
4 | int a,b;string s;cin>>a>>s>>b;
| ^~~~~~
a.cc:4:11: 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:4:20: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
4 | int a,b;string s;cin>>a>>s>>b;
| ^~~
| std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:4:28: error: 's' was not declared in this scope
4 | int a,b;string s;cin>>a>>s>>b;
| ^
a.cc:5:13: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
5 | if(s=='+')cout<<a+b;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:6:8: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
6 | else cout<<a-b;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
|
s373110936 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int A , B;
string op;
cin >> A >> op >> B;
if(op = '+'){
cout << A+B << endl;
}else{
cout << A-B << endl;
}
}
| a.cc: In function 'int main()':
a.cc:7:15: error: could not convert 'op.std::__cxx11::basic_string<char>::operator=(43)' from 'std::__cxx11::basic_string<char>' to 'bool'
7 | if(op = '+'){
| ~~~^~~~~
| |
| std::__cxx11::basic_string<char>
|
s811301643 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int A;
cin >> A;
char op;
cin >> op;
int B;
cin >> B;
cout << A 'op' B << endl;
}
| a.cc:10:19: warning: multi-character character constant [-Wmultichar]
10 | cout << A 'op' B << endl;
| ^~~~
a.cc: In function 'int main()':
a.cc:10:18: error: expected ';' before '\x6f70'
10 | cout << A 'op' B << endl;
| ^~~~~
| ;
|
s294077413 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int A;
cin >> A;
char op;
cin >> op;
int B;
cin >> B;
cout << A op B << endl;
}
| a.cc: In function 'int main()':
a.cc:10:18: error: expected ';' before 'op'
10 | cout << A op B << endl;
| ^~~
| ;
|
s511609462 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int A;
cin >> A;
char op;
cin >> op;
int B;
cin >> B;
cout << A op B << endl;
}
| a.cc: In function 'int main()':
a.cc:10:18: error: expected ';' before 'op'
10 | cout << A op B << endl;
| ^~~
| ;
|
s741584391 | p03844 | C++ | #include<iostream>
#include<string>
#include<typeinfo>
#include<vector>
#include<algorithm>
#include<map>
#include<iomanip>
typedef long long int ll;
using namespace std;
int main()
{
int a,b;
char c;
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:14:21: error: 'op' was not declared in this scope
14 | cin >> a >> op >> b;
| ^~
|
s114430747 | p03844 | C++ | #include<stdio.h>
int main(void)
{
char op;
int a,b,c;
scanf("%c",&op);
if(op=+) {
c=a+b;
}
if(op=-) {
c=a-b;
}
printf("%d\n",c);
return 0;
} | a.cc: In function 'int main()':
a.cc:7:8: error: expected primary-expression before ')' token
7 | if(op=+) {
| ^
a.cc:10:8: error: expected primary-expression before ')' token
10 | if(op=-) {
| ^
|
s122891041 | p03844 | C++ | A,op,B = map(str, input().split())
ans = 0
if op == "+":
ans = A + B
else:
ans = A - B
print(ans) | a.cc:1:1: error: 'A' does not name a type
1 | A,op,B = map(str, input().split())
| ^
|
s199809831 | p03844 | C | #include <stdio.h>
#include <stdlib.h>
#include <math.h>
unsigned long long int a[999999][999999],i,j,k,l,n,m,x,y;
int main()
{
a[1][1]=1;
for(i=1; i<=999999; i++)
{
if(i%2==0)
{
a[i][1]=((i-1)*(i-1))+(j-1);
for(j=2; j<=i; j++)
{
a[i][j]=a[i][1]+1;
}
}
else if(i%2==1)
{
a[i][1]=(i*i);
for(j=2; j<=i; j++)
{
a[i][j]=a[i][1]-(j-1);
}
}
}
for(i=1; i<=999999; i++)
{
if(i%2==0)
{
a[1][i]=(i*i);
for(j=2; j<=i; j++)
{
a[j][i]=a[1][i]-(j-1);
}
}
else if(i%2==1)
{
a[1][i]=((i-1)*(i-1))+1;
for(j=2; j<=i; j++)
{
a[j][i]=a[1][i]+(j-1);
}
}
}
scanf("%llu",&n);
for(m=1;m<=n;m++)
{
scanf("%llu",&x);
for(k=1;k<=999999;k++)
{
for(l=1;l<=999999;l++)
{
if(a[k][l]==x){ printf("Case %llu: %llu %llu\n",m,l,k);break;}
}
if(a[k][l]==x){break;}
}
}
return 0;
}
| /tmp/ccPaKZRY.o: in function `main':
main.c:(.text+0x12): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/ccPaKZRY.o
main.c:(.text+0x22): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/ccPaKZRY.o
main.c:(.text+0x35): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/ccPaKZRY.o
main.c:(.text+0x40): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/ccPaKZRY.o
main.c:(.text+0x4f): relocation truncated to fit: R_X86_64_PC32 against symbol `j' defined in .bss section in /tmp/ccPaKZRY.o
main.c:(.text+0x59): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/ccPaKZRY.o
main.c:(.text+0x76): relocation truncated to fit: R_X86_64_PC32 against symbol `j' defined in .bss section in /tmp/ccPaKZRY.o
main.c:(.text+0x83): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/ccPaKZRY.o
main.c:(.text+0x9c): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/ccPaKZRY.o
main.c:(.text+0xa3): relocation truncated to fit: R_X86_64_PC32 against symbol `j' defined in .bss section in /tmp/ccPaKZRY.o
main.c:(.text+0xcb): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
|
s397083557 | p03844 | C++ | #include<stdio.h>
#include<iostream>
#include<stdlib.h>
#include<string.h>
#include<math.h>
int main()
{ using namespace std;
long long int i,j,k,d,m,res,rem,sum=0,su=0,r,p;
char a[10000],b[10000];
while(gets(a))
{
for(i=0; a[i]!=' '; i++)
{
if(a[i]<='9' && a[i]>='0')
{
b[i] = a[i] - 48;
d = i;
}
}
for(i=d+4; a[i]!='\0'; i++)
{
if(a[i]<='9' && a[i]>='0')
{
b[i] = a[i] - 48;
m = i;
}
}
p = m-(d+4);
rem = pow(10,d);
if(d==2 || d==4 || d==7 || d==8 || d==9) {rem = rem+1;}
res = pow(10,p);
if(p==2 || p==4 || p==7 || p==8 || p==9) {res = res+1;}
for(i=0; i<=d; i++)
{
sum = sum + (b[i]*rem);
rem = rem/10;
}
for(i=d+4; i<=m; i++)
{
su = su + (b[i]*res);
res = res/10;
}
if(a[d+2]=='+') {r=sum+su;}
else if(a[d+2]=='-') {r=sum-su;}
printf("%lld\n",r);
su = 0;
sum = 0;
r = 0;
res = 0;
rem = 0;
d = 0;
m = 0;
p = 0;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:10:11: error: 'gets' was not declared in this scope; did you mean 'getw'?
10 | while(gets(a))
| ^~~~
| getw
|
s232322461 | p03844 | C++ | #include<stdio.h>
#include<string.h>
#include<math.h>
int main()
{
long long int i,j,k,d,m,res,rem,sum=0,su=0,r,p;
char a[10000],b[10000];
while(gets(a))
{
for(i=0; a[i]!=' '; i++)
{
if(a[i]<='9' && a[i]>='0')
{
b[i] = a[i] - 48;
d = i;
}
}
for(i=d+4; a[i]!='\0'; i++)
{
if(a[i]<='9' && a[i]>='0')
{
b[i] = a[i] - 48;
m = i;
}
}
p = m-(d+4);
rem = pow(10,d);
if(d==2 || d==4 || d==7 || d==8 || d==9) {rem = rem+1;}
res = pow(10,p);
if(p==2 || p==4 || p==7 || p==8 || p==9) {res = res+1;}
for(i=0; i<=d; i++)
{
sum = sum + (b[i]*rem);
rem = rem/10;
}
for(i=d+4; i<=m; i++)
{
su = su + (b[i]*res);
res = res/10;
}
if(a[d+2]=='+') {r=sum+su;}
else if(a[d+2]=='-') {r=sum-su;}
printf("%lld\n",r);
su = 0;
sum = 0;
r = 0;
res = 0;
rem = 0;
d = 0;
m = 0;
p = 0;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:8:11: error: 'gets' was not declared in this scope; did you mean 'getw'?
8 | while(gets(a))
| ^~~~
| getw
|
s398921464 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main()
{
//int a,c;
string a,b,c;
cin>>a>>b>>c;
if(b=="+") cout<<a+c;
else if (b=="-") count<<a-c
} | a.cc: In function 'int main()':
a.cc:11:26: error: no match for 'operator-' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
11 | else if (b=="-") count<<a-c
| ~^~
| | |
| | basic_string<[...]>
| basic_string<[...]>
In file included from /usr/include/c++/14/bits/stl_algobase.h:67,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_iterator.h:618:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__y.base() - __x.base())) std::operator-(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
618 | operator-(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:618:5: note: template argument deduction/substitution failed:
a.cc:11:27: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
11 | else if (b=="-") count<<a-c
| ^
/usr/include/c++/14/bits/stl_iterator.h:1790:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__x.base() - __y.base())) std::operator-(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1790 | operator-(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1790:5: note: template argument deduction/substitution failed:
a.cc:11:27: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
11 | else if (b=="-") count<<a-c
| ^
In file included from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/complex:370:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator-(const complex<_Tp>&, const complex<_Tp>&)'
370 | operator-(const complex<_Tp>& __x, const complex<_Tp>& __y)
| ^~~~~~~~
/usr/include/c++/14/complex:370:5: note: template argument deduction/substitution failed:
a.cc:11:27: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::complex<_Tp>'
11 | else if (b=="-") count<<a-c
| ^
/usr/include/c++/14/complex:379:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator-(const complex<_Tp>&, const _Tp&)'
379 | operator-(const complex<_Tp>& __x, const _Tp& __y)
| ^~~~~~~~
/usr/include/c++/14/complex:379:5: note: template argument deduction/substitution failed:
a.cc:11:27: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::complex<_Tp>'
11 | else if (b=="-") count<<a-c
| ^
/usr/include/c++/14/complex:388:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator-(const _Tp&, const complex<_Tp>&)'
388 | operator-(const _Tp& __x, const complex<_Tp>& __y)
| ^~~~~~~~
/usr/include/c++/14/complex:388:5: note: template argument deduction/substitution failed:
a.cc:11:27: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::complex<_Tp>'
11 | else if (b=="-") count<<a-c
| ^
/usr/include/c++/14/complex:465:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator-(const complex<_Tp>&)'
465 | operator-(const complex<_Tp>& __x)
| ^~~~~~~~
/usr/include/c++/14/complex:465:5: note: candidate expects 1 argument, 2 provided
In file included from /usr/include/c++/14/valarray:605,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166:
/usr/include/c++/14/bits/valarray_after.h:406:5: note: candidate: 'template<class _Dom1, class _Dom2> std::_Expr<std::__detail::_BinClos<std::__minus, std::_Expr, std::_Expr, _Dom1, _Dom2>, typename std::__fun<std::__minus, typename _Dom1::value_type>::result_type> std::operator-(const _Expr<_Dom1, typename _Dom1::value_type>&, const _Expr<_Dom2, typename _Dom2::value_type>&)'
406 | _DEFINE_EXPR_BINARY_OPERATOR(-, struct std::__minus)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:406:5: note: template argument deduction/substitution failed:
a.cc:11:27: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>'
11 | else if (b=="-") count<<a-c
| ^
/usr/include/c++/14/bits/valarray_after.h:406:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__minus, std::_Expr, std::_Constant, _Dom, typename _Dom::value_type>, typename std::__fun<std::__minus, typename _Dom1::value_type>::result_type> std::operator-(const _Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&)'
406 | _DEFINE_EXPR_BINARY_OPERATOR(-, struct std::__minus)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:406:5: note: template argument deduction/substitution failed:
a.cc:11:27: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>'
11 | else if (b=="-") count<<a-c
| ^
/usr/include/c++/14/bits/valarray_after.h:406:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__minus, std::_Constant, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__minus, typename _Dom1::value_type>::result_type> std::operator-(const typename _Dom::value_type&, const _Expr<_Dom1, typename _Dom1::value_type>&)'
406 | _DEFINE_EXPR_BINARY_OPERATOR(-, struct std::__minus)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:406:5: note: template argument deduction/substitution failed:
a.cc:11:27: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>'
11 | else if (b=="-") count<<a-c
| ^
/usr/include/c++/14/bits/valarray_after.h:406:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__minus, std::_Expr, std::_ValArray, _Dom, typename _Dom::value_type>, typename std::__fun<std::__minus, typename _Dom1::value_type>::result_type> std::operator-(const _Expr<_Dom1, typename _Dom1::value_type>&, const valarray<typename _Dom::value_type>&)'
406 | _DEFINE_EXPR_BINARY_OPERATOR(-, struct std::__minus)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:406:5: note: template argument deduction/substitution failed:
a.cc:11:27: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>'
11 | else if (b=="-") count<<a-c
| ^
/usr/include/c++/14/bits/valarray_after.h:406:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__minus, std::_ValArray, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__minus, typename _Dom1::value_type>::result_type> std::operator-(const valarray<typename _Dom::value_type>&, const _Expr<_Dom1, typename _Dom1::value_type>&)'
406 | _DEFINE_EXPR_BINARY_OPERATOR(-, struct std::__minus)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:406:5: note: template argument deduction/substitution failed:
a.cc:11:27: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>'
11 | else if (b=="-") count<<a-c
| ^
/usr/include/c++/14/valarray:1197:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__minus, std::_ValArray, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__minus, _Tp>::result_type> std::operator-(const valarray<_Tp>&, const valarray<_Tp>&)'
1197 | _DEFINE_BINARY_OPERATOR(-, __minus)
| ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/valarray:1197:1: note: template argument deduction/substitution failed:
a.cc:11:27: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::valarray<_Tp>'
11 | else if (b=="-") count<<a-c
| ^
/usr/include/c++/14/valarray:1197:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__minus, std::_ValArray, std::_Constant, _Tp, _Tp>, typename std::__fun<std::__minus, _Tp>::result_type> std::operator-(const valarray<_Tp>&, const typename valarray<_Tp>::value_type&)'
1197 | _DEFINE_BINARY_OPERATOR(-, __minus)
| ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/valarray:1197:1: note: template argument deduction/substitution failed:
a.cc:11:27: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::valarray<_Tp>'
11 | else if (b=="-") count<<a-c
| ^
/usr/include/c++/14/valarray:1197:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__minus, std::_Constant, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__minus, _Tp>::result_type> std::operator-(const typename valarray<_Tp>::value_type&, const valarray<_Tp>&)'
1197 | _DEFINE_BINARY_OPERATOR(-, __minus)
| ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/valarray:1197:1: note: template argument deduction/substitution failed:
a.cc:11:27: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::valarray<_Tp>'
11 | else if (b=="-") count<<a-c
| ^
|
s088810454 | p03844 | Java | import java.util.*;
public class shimu{
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
int A = sc.nextInt();
String op = sc.next();
int B = sc.nextInt();
if (op.equals("+")){
System.out.println(A+B);
}
else{
System.out.println(A-B);
}
sc.close();
}
} | Main.java:2: error: class shimu is public, should be declared in a file named shimu.java
public class shimu{
^
1 error
|
s398621950 | p03844 | C++ | #include <iostream>
#include <string>
#include <cmath>
#include <sstream>
#include <iomanip>
using namespace std;
int main(int argc, char* argv[])
{
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(int, char**)':
a.cc:13:9: error: expected initializer before 'char'
13 | char op;
| ^~~~
a.cc:15:21: error: 'op' was not declared in this scope
15 | cin >> A >> op >> B;
| ^~
a.cc:15:27: error: 'B' was not declared in this scope
15 | cin >> A >> op >> B;
| ^
|
s553545296 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int A, B;
string op;
cin >> A >> "op" >> B;
if ( "op" == "+") {
cout << A + B << endl;
}
else if ( "op" == "-") {
cout << A - B << endl;
}
}
| a.cc: In function 'int main()':
a.cc:7:10: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'const char [3]')
7 | cin >> A >> "op" >> B;
| ~~~~~~~~ ^~ ~~~~
| | |
| | const char [3]
| std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}
In file included from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127,
from a.cc:1:
/usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
170 | operator>>(bool& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:170:7: note: conversion of argument 1 would be ill-formed:
a.cc:7:13: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'const char*'
7 | cin >> A >> "op" >> B;
| ^~~~
/usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
174 | operator>>(short& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:174:7: note: conversion of argument 1 would be ill-formed:
a.cc:7:13: error: invalid conversion from 'const char*' to 'short int' [-fpermissive]
7 | cin >> A >> "op" >> B;
| ^~~~
| |
| const char*
a.cc:7:13: error: cannot bind rvalue '(short int)((const char*)"op")' to 'short int&'
/usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
177 | operator>>(unsigned short& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:177:7: note: conversion of argument 1 would be ill-formed:
a.cc:7:13: error: invalid conversion from 'const char*' to 'short unsigned int' [-fpermissive]
7 | cin >> A >> "op" >> B;
| ^~~~
| |
| const char*
a.cc:7:13: error: cannot bind rvalue '(short unsigned int)((const char*)"op")' to 'short unsigned int&'
/usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
181 | operator>>(int& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:181:7: note: conversion of argument 1 would be ill-formed:
a.cc:7:13: error: invalid conversion from 'const char*' to 'int' [-fpermissive]
7 | cin >> A >> "op" >> B;
| ^~~~
| |
| const char*
a.cc:7:13: error: cannot bind rvalue '(int)((const char*)"op")' to 'int&'
/usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
184 | operator>>(unsigned int& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:184:7: note: conversion of argument 1 would be ill-formed:
a.cc:7:13: error: invalid conversion from 'const char*' to 'unsigned int' [-fpermissive]
7 | cin >> A >> "op" >> B;
| ^~~~
| |
| const char*
a.cc:7:13: error: cannot bind rvalue '(unsigned int)((const char*)"op")' to 'unsigned int&'
/usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
188 | operator>>(long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:188:7: note: conversion of argument 1 would be ill-formed:
a.cc:7:13: error: invalid conversion from 'const char*' to 'long int' [-fpermissive]
7 | cin >> A >> "op" >> B;
| ^~~~
| |
| const char*
a.cc:7:13: error: cannot bind rvalue '(long int)((const char*)"op")' to 'long int&'
/usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
192 | operator>>(unsigned long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:192:7: note: conversion of argument 1 would be ill-formed:
a.cc:7:13: error: invalid conversion from 'const char*' to 'long unsigned int' [-fpermissive]
7 | cin >> A >> "op" >> B;
| ^~~~
| |
| const char*
a.cc:7:13: error: cannot bind rvalue '(long unsigned int)((const char*)"op")' to 'long unsigned int&'
/usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
199 | operator>>(long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:199:7: note: conversion of argument 1 would be ill-formed:
a.cc:7:13: error: invalid conversion from 'const char*' to 'long long int' [-fpermissive]
7 | cin >> A >> "op" >> B;
| ^~~~
| |
| const char*
a.cc:7:13: error: cannot bind rvalue '(long long int)((const char*)"op")' to 'long long int&'
/usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
203 | operator>>(unsigned long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:203:7: note: conversion of argument 1 would be ill-formed:
a.cc:7:13: error: invalid conversion from 'const char*' to 'long long unsigned int' [-fpermissive]
7 | cin >> A >> "op" >> B;
| ^~~~
| |
| const char*
a.cc:7:13: error: cannot bind rvalue '(long long unsigned int)((const char*)"op")' to 'long long unsigned int&'
/usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
328 | operator>>(void*& __p)
| ^~~~~~~~
/usr/include/c++/14/istream:328:7: note: conversion of argument 1 would be ill-formed:
a.cc:7:13: error: invalid conversion from 'const void*' to 'void*' [-fpermissive]
7 | cin >> A >> "op" >> B;
| ^~~~
| |
| const void*
a.cc:7:13: error: cannot bind rvalue '(void*)((const void*)((const char*)"op"))' to 'void*&'
/usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
219 | operator>>(float& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from 'const char [3]' to 'float&'
219 | operator>>(float& __f)
| ~~~~~~~^~~
/usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
223 | operator>>(double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from 'const char [3]' to 'double&'
223 | operator>>(double& __f)
| ~~~~~~~~^~~
/usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
227 | operator>>(long double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from 'const char [3]' to 'long double&'
227 | operator>>(long double& __f)
| ~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from 'const char [3]' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'}
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istr |
s620214214 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int A, B;
string op;
cin >> A >> "op" >> B;
if ( "op" == "+") {
cout << A + B << endl;
}
else if ( "op" == "-") {
cout << A - B << endl;
}
}
| a.cc: In function 'int main()':
a.cc:7:10: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'const char [3]')
7 | cin >> A >> "op" >> B;
| ~~~~~~~~ ^~ ~~~~
| | |
| | const char [3]
| std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}
In file included from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127,
from a.cc:1:
/usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
170 | operator>>(bool& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:170:7: note: conversion of argument 1 would be ill-formed:
a.cc:7:13: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'const char*'
7 | cin >> A >> "op" >> B;
| ^~~~
/usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
174 | operator>>(short& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:174:7: note: conversion of argument 1 would be ill-formed:
a.cc:7:13: error: invalid conversion from 'const char*' to 'short int' [-fpermissive]
7 | cin >> A >> "op" >> B;
| ^~~~
| |
| const char*
a.cc:7:13: error: cannot bind rvalue '(short int)((const char*)"op")' to 'short int&'
/usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
177 | operator>>(unsigned short& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:177:7: note: conversion of argument 1 would be ill-formed:
a.cc:7:13: error: invalid conversion from 'const char*' to 'short unsigned int' [-fpermissive]
7 | cin >> A >> "op" >> B;
| ^~~~
| |
| const char*
a.cc:7:13: error: cannot bind rvalue '(short unsigned int)((const char*)"op")' to 'short unsigned int&'
/usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
181 | operator>>(int& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:181:7: note: conversion of argument 1 would be ill-formed:
a.cc:7:13: error: invalid conversion from 'const char*' to 'int' [-fpermissive]
7 | cin >> A >> "op" >> B;
| ^~~~
| |
| const char*
a.cc:7:13: error: cannot bind rvalue '(int)((const char*)"op")' to 'int&'
/usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
184 | operator>>(unsigned int& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:184:7: note: conversion of argument 1 would be ill-formed:
a.cc:7:13: error: invalid conversion from 'const char*' to 'unsigned int' [-fpermissive]
7 | cin >> A >> "op" >> B;
| ^~~~
| |
| const char*
a.cc:7:13: error: cannot bind rvalue '(unsigned int)((const char*)"op")' to 'unsigned int&'
/usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
188 | operator>>(long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:188:7: note: conversion of argument 1 would be ill-formed:
a.cc:7:13: error: invalid conversion from 'const char*' to 'long int' [-fpermissive]
7 | cin >> A >> "op" >> B;
| ^~~~
| |
| const char*
a.cc:7:13: error: cannot bind rvalue '(long int)((const char*)"op")' to 'long int&'
/usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
192 | operator>>(unsigned long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:192:7: note: conversion of argument 1 would be ill-formed:
a.cc:7:13: error: invalid conversion from 'const char*' to 'long unsigned int' [-fpermissive]
7 | cin >> A >> "op" >> B;
| ^~~~
| |
| const char*
a.cc:7:13: error: cannot bind rvalue '(long unsigned int)((const char*)"op")' to 'long unsigned int&'
/usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
199 | operator>>(long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:199:7: note: conversion of argument 1 would be ill-formed:
a.cc:7:13: error: invalid conversion from 'const char*' to 'long long int' [-fpermissive]
7 | cin >> A >> "op" >> B;
| ^~~~
| |
| const char*
a.cc:7:13: error: cannot bind rvalue '(long long int)((const char*)"op")' to 'long long int&'
/usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
203 | operator>>(unsigned long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:203:7: note: conversion of argument 1 would be ill-formed:
a.cc:7:13: error: invalid conversion from 'const char*' to 'long long unsigned int' [-fpermissive]
7 | cin >> A >> "op" >> B;
| ^~~~
| |
| const char*
a.cc:7:13: error: cannot bind rvalue '(long long unsigned int)((const char*)"op")' to 'long long unsigned int&'
/usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
328 | operator>>(void*& __p)
| ^~~~~~~~
/usr/include/c++/14/istream:328:7: note: conversion of argument 1 would be ill-formed:
a.cc:7:13: error: invalid conversion from 'const void*' to 'void*' [-fpermissive]
7 | cin >> A >> "op" >> B;
| ^~~~
| |
| const void*
a.cc:7:13: error: cannot bind rvalue '(void*)((const void*)((const char*)"op"))' to 'void*&'
/usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
219 | operator>>(float& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from 'const char [3]' to 'float&'
219 | operator>>(float& __f)
| ~~~~~~~^~~
/usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
223 | operator>>(double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from 'const char [3]' to 'double&'
223 | operator>>(double& __f)
| ~~~~~~~~^~~
/usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
227 | operator>>(long double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from 'const char [3]' to 'long double&'
227 | operator>>(long double& __f)
| ~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from 'const char [3]' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'}
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istr |
s359775660 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int A, B;
string "op";
cin >> A >> "op" >> B;
if ( "op" == "+") {
cout << A + B << endl;
}
else if ( "op" == "-") {
cout << A - B << endl;
}
}
| a.cc: In function 'int main()':
a.cc:6:10: error: expected unqualified-id before string constant
6 | string "op";
| ^~~~
a.cc:7:10: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'const char [3]')
7 | cin >> A >> "op" >> B;
| ~~~~~~~~ ^~ ~~~~
| | |
| | const char [3]
| std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}
In file included from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127,
from a.cc:1:
/usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
170 | operator>>(bool& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:170:7: note: conversion of argument 1 would be ill-formed:
a.cc:7:13: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'const char*'
7 | cin >> A >> "op" >> B;
| ^~~~
/usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
174 | operator>>(short& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:174:7: note: conversion of argument 1 would be ill-formed:
a.cc:7:13: error: invalid conversion from 'const char*' to 'short int' [-fpermissive]
7 | cin >> A >> "op" >> B;
| ^~~~
| |
| const char*
a.cc:7:13: error: cannot bind rvalue '(short int)((const char*)"op")' to 'short int&'
/usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
177 | operator>>(unsigned short& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:177:7: note: conversion of argument 1 would be ill-formed:
a.cc:7:13: error: invalid conversion from 'const char*' to 'short unsigned int' [-fpermissive]
7 | cin >> A >> "op" >> B;
| ^~~~
| |
| const char*
a.cc:7:13: error: cannot bind rvalue '(short unsigned int)((const char*)"op")' to 'short unsigned int&'
/usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
181 | operator>>(int& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:181:7: note: conversion of argument 1 would be ill-formed:
a.cc:7:13: error: invalid conversion from 'const char*' to 'int' [-fpermissive]
7 | cin >> A >> "op" >> B;
| ^~~~
| |
| const char*
a.cc:7:13: error: cannot bind rvalue '(int)((const char*)"op")' to 'int&'
/usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
184 | operator>>(unsigned int& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:184:7: note: conversion of argument 1 would be ill-formed:
a.cc:7:13: error: invalid conversion from 'const char*' to 'unsigned int' [-fpermissive]
7 | cin >> A >> "op" >> B;
| ^~~~
| |
| const char*
a.cc:7:13: error: cannot bind rvalue '(unsigned int)((const char*)"op")' to 'unsigned int&'
/usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
188 | operator>>(long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:188:7: note: conversion of argument 1 would be ill-formed:
a.cc:7:13: error: invalid conversion from 'const char*' to 'long int' [-fpermissive]
7 | cin >> A >> "op" >> B;
| ^~~~
| |
| const char*
a.cc:7:13: error: cannot bind rvalue '(long int)((const char*)"op")' to 'long int&'
/usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
192 | operator>>(unsigned long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:192:7: note: conversion of argument 1 would be ill-formed:
a.cc:7:13: error: invalid conversion from 'const char*' to 'long unsigned int' [-fpermissive]
7 | cin >> A >> "op" >> B;
| ^~~~
| |
| const char*
a.cc:7:13: error: cannot bind rvalue '(long unsigned int)((const char*)"op")' to 'long unsigned int&'
/usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
199 | operator>>(long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:199:7: note: conversion of argument 1 would be ill-formed:
a.cc:7:13: error: invalid conversion from 'const char*' to 'long long int' [-fpermissive]
7 | cin >> A >> "op" >> B;
| ^~~~
| |
| const char*
a.cc:7:13: error: cannot bind rvalue '(long long int)((const char*)"op")' to 'long long int&'
/usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
203 | operator>>(unsigned long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:203:7: note: conversion of argument 1 would be ill-formed:
a.cc:7:13: error: invalid conversion from 'const char*' to 'long long unsigned int' [-fpermissive]
7 | cin >> A >> "op" >> B;
| ^~~~
| |
| const char*
a.cc:7:13: error: cannot bind rvalue '(long long unsigned int)((const char*)"op")' to 'long long unsigned int&'
/usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
328 | operator>>(void*& __p)
| ^~~~~~~~
/usr/include/c++/14/istream:328:7: note: conversion of argument 1 would be ill-formed:
a.cc:7:13: error: invalid conversion from 'const void*' to 'void*' [-fpermissive]
7 | cin >> A >> "op" >> B;
| ^~~~
| |
| const void*
a.cc:7:13: error: cannot bind rvalue '(void*)((const void*)((const char*)"op"))' to 'void*&'
/usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
219 | operator>>(float& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from 'const char [3]' to 'float&'
219 | operator>>(float& __f)
| ~~~~~~~^~~
/usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
223 | operator>>(double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from 'const char [3]' to 'double&'
223 | operator>>(double& __f)
| ~~~~~~~~^~~
/usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
227 | operator>>(long double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from 'const char [3]' to 'long double&'
227 | operator>>(long double& __f)
| ~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from 'const char [3]' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'}
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _T |
s205500652 | p03844 | C++ | #include <bits/stdc++.h>
#include <numeric>
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
int a,b,
string op;
cin >> a >> op >> b;
cout << (op=="+"?a+b:a-b) << endl;
}
| a.cc: In function 'int main()':
a.cc:10:12: error: expected initializer before 'op'
10 | string op;
| ^~
a.cc:11:17: error: 'op' was not declared in this scope
11 | cin >> a >> op >> b;
| ^~
|
s014955987 | p03844 | C++ | #include <bits/stdc++.h>
#include <numeric>
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
int a,b,
string op;
cin >> a >> op >> b;
cout << (op=='+'?a+b:a-b) << endl;
}
| a.cc: In function 'int main()':
a.cc:10:12: error: expected initializer before 'op'
10 | string op;
| ^~
a.cc:11:17: error: 'op' was not declared in this scope
11 | cin >> a >> op >> b;
| ^~
|
s165123251 | p03844 | C++ | read a b c; [ $b = '+' ] && echo $[a+c] || echo $[a-c] | a.cc:1:1: error: 'read' does not name a type
1 | read a b c; [ $b = '+' ] && echo $[a+c] || echo $[a-c]
| ^~~~
a.cc:1:13: error: expected unqualified-id before '[' token
1 | read a b c; [ $b = '+' ] && echo $[a+c] || echo $[a-c]
| ^
|
s453556431 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int a,b;
string op;
cin >> a >>op>>b;
if(op == "+")
cout << a+b << endl;
else
cout << a-b << endl;
| a.cc: In function 'int main()':
a.cc:12:23: error: expected '}' at end of input
12 | cout << a-b << endl;
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s461805955 | p03844 | C++ | #include <iostream>
using namespace std;
int main() {
int a, b;
string op;
cin >> a >> op >> b;
if (op == '+') {
cout << a + b << endl;
} else {
cout << a - b << endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:8:12: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
8 | if (op == '+') {
| ~~ ^~ ~~~
| | |
| | char
| std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/iosfwd:42,
from /usr/include/c++/14/ios:40,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/postypes.h:192:5: note: candidate: 'template<class _StateT> bool std::operator==(const fpos<_StateT>&, const fpos<_StateT>&)'
192 | operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/postypes.h:192:5: note: template argument deduction/substitution failed:
a.cc:8:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::fpos<_StateT>'
8 | if (op == '+') {
| ^~~
In file included from /usr/include/c++/14/string:43,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44:
/usr/include/c++/14/bits/allocator.h:235:5: note: candidate: 'template<class _T1, class _T2> bool std::operator==(const allocator<_CharT>&, const allocator<_T2>&)'
235 | operator==(const allocator<_T1>&, const allocator<_T2>&)
| ^~~~~~~~
/usr/include/c++/14/bits/allocator.h:235:5: note: template argument deduction/substitution failed:
a.cc:8:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::allocator<_CharT>'
8 | if (op == '+') {
| ^~~
In file included from /usr/include/c++/14/string:48:
/usr/include/c++/14/bits/stl_iterator.h:441:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
441 | operator==(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:441:5: note: template argument deduction/substitution failed:
a.cc:8:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
8 | if (op == '+') {
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:486:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
486 | operator==(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:486:5: note: template argument deduction/substitution failed:
a.cc:8:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
8 | if (op == '+') {
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:1667:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1667 | operator==(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1667:5: note: template argument deduction/substitution failed:
a.cc:8:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
8 | if (op == '+') {
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:1737:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1737 | operator==(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1737:5: note: template argument deduction/substitution failed:
a.cc:8:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
8 | if (op == '+') {
| ^~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/string:51:
/usr/include/c++/14/bits/stl_pair.h:1033:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator==(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1033 | operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1033:5: note: template argument deduction/substitution failed:
a.cc:8:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>'
8 | if (op == '+') {
| ^~~
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54:
/usr/include/c++/14/string_view:629:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator==(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)'
629 | operator==(basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:629:5: note: template argument deduction/substitution failed:
a.cc:8:15: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
8 | if (op == '+') {
| ^~~
/usr/include/c++/14/string_view:637:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator==(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)'
637 | operator==(basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:637:5: note: template argument deduction/substitution failed:
a.cc:8:15: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
8 | if (op == '+') {
| ^~~
/usr/include/c++/14/string_view:644:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator==(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)'
644 | operator==(__type_identity_t<basic_string_view<_CharT, _Traits>> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:644:5: note: template argument deduction/substitution failed:
a.cc:8:15: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'char'
8 | if (op == '+') {
| ^~~
/usr/include/c++/14/bits/basic_string.h:3755:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3755 | operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3755:5: note: template argument deduction/substitution failed:
a.cc:8:15: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'char'
8 | if (op == '+') {
| ^~~
/usr/include/c++/14/bits/basic_string.h:3772:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)'
3772 | operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3772:5: note: template argument deduction/substitution failed:
a.cc:8:15: note: mismatched types 'const _CharT*' and 'char'
8 | if (op == '+') {
| ^~~
/usr/include/c++/14/bits/basic_string.h:3819:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3819 | operator==(const _CharT* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3819:5: note: template argument deduction/substitution failed:
a.cc:8:15: note: mismatched types 'const _CharT*' and 'std::__cxx11::basic_string<char>'
8 | if (op == '+') {
| ^~~
In file included from /usr/include/c++/14/bits/memory_resource.h:47,
from /usr/include/c++/14/string:68:
/usr/include/c++/14/tuple:2558:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator==(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)'
2558 | operator==(const tuple<_TElements...>& __t,
| ^~~~~~~~
/usr/include/c++/14/tuple:2558:5: note: template argument deduction/substitution failed:
a.cc:8:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::tuple<_UTypes ...>'
8 | if (op == '+') {
| ^~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
from /usr/include/c++/14/bits/basic_ios.h:37,
from /usr/include/c++/14/ios:46:
/usr/include/c++/14/bits/streambuf_iterator.h:234:5: note: candidate: 'template<class _CharT, class _Traits> bool std::operator==(const istreambuf_iterator<_CharT, _Traits>&, const istreambuf_iterator<_CharT, _Traits>&)'
234 | operator==(const istreambuf_iterator<_CharT, _Traits>& __a,
| ^~~~~~~~
/usr/include/c++/14/bits/streambuf_iterator.h:234:5: note: template argument deduction/substitution failed:
a.cc:8:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::istreambuf_iterator<_CharT, _Traits>'
8 | if (op == '+') {
| ^~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/c++allocator.h:33,
from /usr/include/c++/14/bits/allocator.h:46:
/usr/include/c++/14/bits/new_allocator.h:215:9: note: candidate: 'template<class _Up> bool std::operator==(const __new_allocator<char>&, const __new_allocator<_Tp>&)'
215 | operator==(const __new_allocator&, const __new |
s897632253 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int a,b;
char op;
cin >> a >> op >> b;
cout << (op=='+' ? a+b : a-b) endl;
} | a.cc: In function 'int main()':
a.cc:8:34: error: expected ';' before 'endl'
8 | cout << (op=='+' ? a+b : a-b) endl;
| ^~~~~
| ;
|
s235786722 | p03844 | C++ | #include "pch.h"
#include <iostream>
#include <string>
using namespace std;
int main() {
int a, b;
char op;
cin >> a;
getchar();
cin >> op;
getchar();
cin >> b;
if (op == '+')a += b;
else a -= b;
cout << a << endl;
system("pause");
return 0;
} | a.cc:1:10: fatal error: pch.h: No such file or directory
1 | #include "pch.h"
| ^~~~~~~
compilation terminated.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.