submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s919867513 | p03844 | C++ | #include<iostream>
using namespace std;
int main(){
int A,B = 0;
char op = '';
cin >> A >> op >> B;
if(op=='+')
cout << A+B << endl;
else
cout << A-B << endl;
} | a.cc:6:13: error: empty character constant
6 | char op = '';
| ^~
|
s808367906 | p03844 | C++ | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
String inputTxt = sc.nextLine();
int ans = 0;
String[] arrTxt = inputTxt.split(" ");
int left = Integer.parseInt(arrTxt[0]);
int right = Integer.parseInt(arrTxt[2]);
if ("... | a.cc:1:1: error: 'import' does not name a type
1 | import java.util.*;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: expected unqualified-id before 'public'
2 | public class Main {
| ^~~~~~
|
s119640484 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int A,B;
string op;
cin>>A>>op>>B;
cout<<AopB<<endl;
} | a.cc: In function 'int main()':
a.cc:8:9: error: 'AopB' was not declared in this scope; did you mean 'op'?
8 | cout<<AopB<<endl;
| ^~~~
| op
|
s787785982 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int A,B;
char op;
cin>>A>>op>>B;
cout<<AopB<<endl;
}
| a.cc: In function 'int main()':
a.cc:8:9: error: 'AopB' was not declared in this scope; did you mean 'op'?
8 | cout<<AopB<<endl;
| ^~~~
| op
|
s974965629 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int A,B,op;
cin>>A>>op>>B;
cout<<AopB<<endl;
}
| a.cc: In function 'int main()':
a.cc:7:9: error: 'AopB' was not declared in this scope; did you mean 'op'?
7 | cout<<AopB<<endl;
| ^~~~
| op
|
s306053921 | 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;
}
| a.cc: In function 'int main()':
a.cc:10:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
10 | if(op == "+")
| ~~~^~~~~~
|
s183337799 | p03844 | C++ | int a, b;
string op;
cin >> a >> op >> b;
if (op == "+")
return a + b;
else
return a - b; | a.cc:2:1: error: 'string' does not name a type
2 | string op;
| ^~~~~~
a.cc:3:1: error: 'cin' does not name a type
3 | cin >> a >> op >> b;
| ^~~
a.cc:5:1: error: expected unqualified-id before 'if'
5 | if (op == "+")
| ^~
a.cc:7:1: error: expected unqualified-id before 'else'
7 | else... |
s205005627 | p03844 | C++ | int a;
int b;
cin>>a;
cout << a << endl; | a.cc:3:1: error: 'cin' does not name a type
3 | cin>>a;
| ^~~
a.cc:4:1: error: 'cout' does not name a type
4 | cout << a << endl;
| ^~~~
|
s927951502 | p03844 | C++ | #include<iostream>
using namespace std;
int main(){
char op;
int a,b;
cin>>a>>op>>b;
if(c=='+')cout<<a+b;
else cout<<a-b;
return 0;
} | a.cc: In function 'int main()':
a.cc:9:6: error: 'c' was not declared in this scope
9 | if(c=='+')cout<<a+b;
| ^
|
s996503783 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int A,B;
char op;
cin>>A>>op>>B;
if(c=='+') cout<<A+B<<endl;
else if(c=='-') cout<<A-B<<endl;
else return 0;
return 0;
} | a.cc: In function 'int main()':
a.cc:8:8: error: 'c' was not declared in this scope
8 | if(c=='+') cout<<A+B<<endl;
| ^
|
s645186554 | 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 (op = '-'){
cout << A-B << endl;
}
} | a.cc: In function 'int main()':
a.cc:15:20: error: expected ';' before '{' token
15 | else (op = '-'){
| ^
| ;
|
s068059556 | 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 (op == "+"){
cout << A + B << endl;
}
} | a.cc: In function 'int main()':
a.cc:12:19: error: expected ';' before '{' token
12 | else (op == "+"){
| ^
| ;
a.cc:12:12: warning: ignoring return value of 'bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*) [with _CharT ... |
s364690246 | p03844 | C | #include<stdio.h>
int main()
{
int a,b;
char c;
scanf("%d%c%d",&a,&c,&b);
if(c=='+')pritnf("%d\n",a+b);
else printf("%d\n",a-b);
return 0;
} | main.c: In function 'main':
main.c:7:15: error: implicit declaration of function 'pritnf'; did you mean 'printf'? [-Wimplicit-function-declaration]
7 | if(c=='+')pritnf("%d\n",a+b);
| ^~~~~~
| printf
|
s086971298 | p03844 | C | #include<stdio.h>
int main()
{
int a,b;
char c;
scanf("%d%c%d",&a,&c,&b);
if(c=='+')pritnf("%d\n",a+b);
else pritnf("%d\n",a-b);
return 0;
} | main.c: In function 'main':
main.c:7:15: error: implicit declaration of function 'pritnf'; did you mean 'printf'? [-Wimplicit-function-declaration]
7 | if(c=='+')pritnf("%d\n",a+b);
| ^~~~~~
| printf
|
s662052107 | p03844 | C | #include<stdio.h>
using namespace std;
int main()
{
int a,b;
char c;
scanf("%d%c%d",&a,&c,&b);
if(c=='+')pritnf("%d\n",a+b);
else pritnf("%d\n",a-b);
return 0;
} | main.c:2:1: error: unknown type name 'using'
2 | using namespace std;
| ^~~~~
main.c:2:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'std'
2 | using namespace std;
| ^~~
main.c: In function 'main':
main.c:8:15: error: implicit declaration of function 'pritnf'; di... |
s147900480 | 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:9: error: could not convert 'op.std::__cxx11::basic_string<char>::operator=(((const char*)"+"))' from 'std::__cxx11::basic_string<char>' to 'bool'
9 | if(op = "+")
| ~~~^~~~~
| |
| std::__cxx11::basic_string<char>
|
s351447289 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int A, B;
char op;
cin >> A >> op >> C;
if(op == '+'){
cout << A + B << endl;
}
else{
cout << A - B << endl;
}
}
| a.cc: In function 'int main()':
a.cc:7:21: error: 'C' was not declared in this scope
7 | cin >> A >> op >> C;
| ^
|
s897421157 | p03844 | C++ | #include<iostream>
using namespace std;
int main(){
int a,b;
char oper;
bool type;
cin>>a>>oper>>b;
if(oper=="+") type=true; else type=false;
if(type) cout<<a+b<<endl; else cout<<a-b<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:8:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
8 | if(oper=="+") type=true; else type=false;
| ~~~~^~~~~
|
s262650720 | p03844 | C++ | #include<iostream>
using namespace std;
int main(){
int a,b;
char oper;
bool type;
cin>>a>>oper>>b;
if(oper=="+") type=1;
else type=0;
if(type) cout<<a+b<<endl;
else cout<<a-b<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:8:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
8 | if(oper=="+") type=1;
| ~~~~^~~~~
|
s105800814 | p03844 | C++ | a=int(input())
b=int(input())
add="+"
sub="-"
op=str(input())
if (op==add):
print(a+b)
elif(op==sub):
print(a-b)
else:
print("error")
| a.cc:1:1: error: 'a' does not name a type
1 | a=int(input())
| ^
|
s929009151 | p03844 | C++ | #include<iostream>
#include<cstdlib>
#include<map>
#include<cmath>
using namespace std;
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
int n;
cin >> n;
map<int, int> counter;
int num;
for(int i=0;i<n;i++){
cin >> num;
if(counter[num] == 0){
counter[num] ... | a.cc: In function 'int main()':
a.cc:42:29: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator%'
42 | cout << std::pow(2, n/2)%(std::pow(20, 9)+7) << endl;
| ~~~~~~~~~~~~~~~~^~~~~~~... |
s943527311 | p03844 | C++ | #include <iostream>
#include <string>
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:9:12: warning: missing terminating ' character
9 | if(op=='='+'){
| ^
a.cc:9:12: error: missing terminating ' character
9 | if(op=='='+'){
| ^~~
a.cc: In function 'int main()':
a.cc:9:11: error: no match for 'operator+' (operand types are 'char' and 'std::ostream' {aka 'st... |
s300393550 | p03844 | C++ | #include <iostream>
using namespace std;
int main() {
int x=0;
int a,b;
cin>>a>>b;
x=a+b;
cout<<x;
return 0;
| a.cc: In function 'int main()':
a.cc:9:14: error: expected '}' at end of input
9 | return 0;
| ^
a.cc:3:12: note: to match this '{'
3 | int main() {
| ^
|
s068644977 | 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:8: error: expected primary-expression before '>' token
7 | cin > > a >> op >> b ;
| ^
a.cc:7:12: error: no match for 'operator>>' (operand types are 'int' and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
7 | cin > > a >> op >> b ;
| ... |
s785291537 | p03844 | C++ | #include <iostream>
using namespace std;
int main() {
int A,B; char op;
cin >> A>>op>> b;
if (op=='+') cout<<A+B;
else if (op=='-') cout<<A-B;
return 0;
} | a.cc: In function 'int main()':
a.cc:7:18: error: 'b' was not declared in this scope
7 | cin >> A>>op>> b;
| ^
|
s800728600 | p03844 | C++ | #include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#include <iostream>
#include<map>
#include <algorithm>
#include <vector>
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
int a, b;
string op;
cin >> a >> b >> op;
if(op == '+') cout << a + b << endl;
el... | a.cc: In function 'int main()':
a.cc:15:7: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
15 | if(op == '+') cout << a + b << endl;
| ~~ ^~ ~~~
| | |
| | char
| std::string {aka std::__cxx11::basic_str... |
s558674619 | p03844 | Java | import java.util.*;
public class Main{
public static void main(String args[]) {
Scanner in = new Scanner(System.in);
int A = in.nextInt();
String op = in.next();
int B = in.nextInt();
if (op.equals("+"))
System.out.println(A+N);
else if (op.equals("-")
System.out.... | Main.java:10: error: ')' expected
else if (op.equals("-")
^
1 error
|
s558805642 | p03844 | C++ | int a, b;
string op;
cin >> a >> op >> b;
if(op == "+")
cout << a + b << endl;
else
cout << a-b << endl; | a.cc:2:1: error: 'string' does not name a type
2 | string op;
| ^~~~~~
a.cc:3:1: error: 'cin' does not name a type
3 | cin >> a >> op >> b;
| ^~~
a.cc:4:1: error: expected unqualified-id before 'if'
4 | if(op == "+")
| ^~
a.cc:6:1: error: expected unqualified-id before 'else'
6 | else
... |
s637235864 | p03844 | C++ | #include<iostream>
using namespace std;
int main()
{
int a,b;
cin>>a>>b;
int sub,sum;
char c;
sum=a+b;
sub=a-b;
if (c=='+') {
cout<<sum<<endl;
|}else{
cout<<sub<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:13:5: error: expected primary-expression before '|' token
13 | |}else{
| ^
a.cc:13:6: error: expected primary-expression before '}' token
13 | |}else{
| ^
|
s688229169 | p03844 | C++ | #include<iostream>
using namespace std;
int main()
{
int a,b;
cin>>a>>b;
int sub,sum;
char c;
sum=a+b;
sub=a-b
if (c=='+')
cout<<sum<<endl;
else
cout<<sub<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:10:12: error: expected ';' before 'if'
10 | sub=a-b
| ^
| ;
11 | if (c=='+')
| ~~
a.cc:13:5: error: 'else' without a previous 'if'
13 | else
| ^~~~
|
s150557847 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int A, B;
char op;
int result;
cin >> A >> op >> B;
if (op == '+'){
result = A + B;
}
else if (op == '-'){
result = A - B;
}
cout << result << endl;
}
} | a.cc:17:1: error: expected declaration before '}' token
17 | }
| ^
|
s062720925 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int a=0, b=0;
string s;
cin >> a >> s >> b;
if(s=='+') {
int sum = a+b;
cout << sum << endl;
} else if(s=='-') {
int sub = a-b;
cout << sub << endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:10:7: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
10 | if(s=='+') {
| ~^~~~~
| | |
| | char
| std::string {aka std::__cxx11::basic_string<char>}
In file incl... |
s044175900 | 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:6: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
9 | if(op=="+"){
| ~~^~~~~
|
s981071403 | 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:6: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
9 | if(op=="+"){
| ~~^~~~~
a.cc:14:2: error: expected '}' at end of input
14 | }
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s195171140 | p03844 | C++ | #include <iostream>
using namespace std;
int main()
{
char input;
int num1, num2;
cin >> num1;
cin >> num2;
cin >> input;
if (input == "+")
{
cout << num1 + num2;
}
else if (input == "-")
{
cout << num1 - num2;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:10:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
10 | if (input == "+")
| ~~~~~~^~~~~~
a.cc:15:20: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
15 | else if (input == "-")
| ... |
s565760099 | p03844 | Java | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String a = sc.next();
String op = sc.next();
String b = sc.next();
long a = Long.parseLong(a);
long b = Long.parseLong(b);
long ans = a + b;
if(op.equals("-")) ans = a... | Main.java:9: error: variable a is already defined in method main(String[])
long a = Long.parseLong(a);
^
Main.java:9: error: incompatible types: long cannot be converted to String
long a = Long.parseLong(a);
^
Main.java:10: error: variable b is already defined in method main... |
s154931292 | p03844 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int a,b;
string c;
cin >> a >> c >> b;
if(c == '+')
cout << a+b << endl;
if(c == '-')
cout << a-b << endl;
if(c == '*')
cout << a*b << endl;
if(c == '/')
cout << a/b << endl;
} | a.cc: In function 'int main()':
a.cc:7:8: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
7 | if(c == '+')
| ~ ^~ ~~~
| | |
| | char
| std::string {aka std::__cxx11::basic_string<char>}
In file... |
s208993581 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int A,B;
string op;
cin >> A >> op >> B ;
if( op == "+"){
} | a.cc: In function 'int main()':
a.cc:15:2: error: expected '}' at end of input
15 | }
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s067965985 | p03844 | C | #include <bits/stdc++.h>
#define rep(i,n) for(int64_t i=0;i < (int64_t)(n);i++)
using namespace std;
//////全探索したいときに開けよ////////
vector<vector<int>> fspattern;
vector<int> fspattern_draft;
int fspcnt = 0;
void setfspattern_core(int floor,int number,int degree){
if(floor==degree){
fspattern.at(fspcnt) = fspattern... | main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
1 | #include <bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s047868693 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int a,b;
string op;
cin zz. a >> b >> op;
if (op == "+") {
cout << a + b << endl;
}
else if (op == "-") {
cout << a - b << endl;
}
} | a.cc: In function 'int main()':
a.cc:7:6: error: expected ';' before 'zz'
7 | cin zz. a >> b >> op;
| ^~~
| ;
|
s179618001 | 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:8: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
9 | if(op=="+")
| ~~^~~~~
|
s654657228 | p03844 | C++ | /*
ID: tohoast1
TASK: gymnastics
LANG: C++
*/
#include <bits/stdc++.h>
#define speedup ios_base::sync_with_stdio(NULL)
#define fin freopen("gymnastics.in", "r", stdin)
#define fout freopen("gymnastics.out", "w", stdout)
#define FILENAME
#define PUBG push_back
#define p_b pop_back
#define mp make_pair
#define fi first
#... | a.cc: In function 'int main()':
a.cc:41:12: error: no match for 'operator==' (operand types are 'STR' {aka 'std::__cxx11::basic_string<char>'} and 'char')
41 | if (pm == '+') cout << a + b;
| ~~ ^~ ~~~
| | |
| | char
| STR {aka std::__cxx11::basic_s... |
s564565310 | p03844 | C++ | #include <iostream>
using namespace std;
int main(){
int A,C;
string B;
cin A >> B >> C;
if(B=="+"){
cout << A+C << endl;
}
else{
cout << A-C << endl;
}
}
| a.cc: In function 'int main()':
a.cc:6:6: error: expected ';' before 'A'
6 | cin A >> B >> C;
| ^~
| ;
|
s358549399 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int a,b;
string s;
cin>>a>>s>>b;
cout<<(s=='+' ? a+b:a-b)<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:8:11: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
8 | cout<<(s=='+' ? a+b:a-b)<<endl;
| ~^~~~~
| | |
| | char
| std::string {aka std::__cxx1... |
s060136666 | p03844 | C++ | #include <iostream>
#include <string>
int main() {
std int a,c;
std::string b;
std::cin >>a>>b>>c;
if(b == "+"){
std::cout<<a+c;
}else if(b == "-"){
std::cout<<a-c;
}else{}
} | a.cc: In function 'int main()':
a.cc:5:7: error: expected primary-expression before 'int'
5 | std int a,c;
| ^~~
a.cc:7:14: error: 'a' was not declared in this scope
7 | std::cin >>a>>b>>c;
| ^
a.cc:7:20: error: 'c' was not declared in this scope
7 | std::cin >>a>>b>>c;
... |
s690212632 | p03844 | C++ | #include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <functional>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll, ll> P... | a.cc: In function 'int main()':
a.cc:37:10: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
37 | if(s == '+') {
| ~ ^~ ~~~
| | |
| | char
| std::string {aka std::__cxx11::basic_string<... |
s229767132 | p03844 | C++ | #include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
using namespace std;
int main() {
string x,y,z;
cin>>x>>z>>y;
if (z == "+") cout<<atoi(x)+atoi(y)<<endl;
else cout<<atoi(x)-atoi(y)<<end... | a.cc: In function 'int main()':
a.cc:14:28: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
14 | if (z == "+") cout<<atoi(x)+atoi(y)<<endl;
| ^
| |
| std::string {aka std... |
s066199082 | p03844 | Java | import java.util.*;
public class Main{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
char op = sc.nextchar();
int b = sc.nextInt();
System.out.println(op=='+' ? a+b:a-b);
}
}
| Main.java:8: error: cannot find symbol
char op = sc.nextchar();
^
symbol: method nextchar()
location: variable sc of type Scanner
1 error
|
s690648330 | p03844 | Java | import java.util.*;
public class Main{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
String op = sc.next();
int b = sc.nextInt();
System.out.println(op=='+' ? a+b:a-b);
}
}
| Main.java:11: error: bad operand types for binary operator '=='
System.out.println(op=='+' ? a+b:a-b);
^
first type: String
second type: char
1 error
|
s306066160 | p03844 | C++ | package main
import (
"fmt"
)
func main() {
var A,B int
var op string
fmt.Scan(&A,&op,&B)
if op == "+" {
fmt.Println(A+B)
} else if op == "-" {
fmt.Println(A-B)
} else {
fmt.Println("error")
}
} | a.cc:1:1: error: 'package' does not name a type
1 | package main
| ^~~~~~~
|
s616620072 | p03844 | C++ | #pragma gcc optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(V) (V).begin(),(V).end()
#define SORT(V) sort(ALL(V)) //小さい方からソート
#define REV(V) reverse(ALL(V)) //リバース
#define RSORT(V) SOR... | a.cc: In function 'int main()':
a.cc:62:7: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
62 | if(n=="+") OUT(a+b);
| ~^~~~~
|
s005447091 | p03844 | Java | import java.util.*;
class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
String op = sc.next();
int b = sc.nextInt();
if(op.equals("+"){
System.out.println(a + b);
}else{
System.out.println(a - b);
... | Main.java:9: error: ')' expected
if(op.equals("+"){
^
1 error
|
s373321390 | p03844 | Java | import java.util.Scanner;
public class Abc050A {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
String o = sc.next();
int b = sc.nextInt();
if (o.equals("+")) {
System.out.println(a + b);
} else {
System.out.println(a - b);
... | Main.java:3: error: class Abc050A is public, should be declared in a file named Abc050A.java
public class Abc050A {
^
1 error
|
s787702897 | p03844 | C++ | #define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define bg begin()
#define ed end()
#define all(x) x.bg, x.ed
#ifdef LOCAL
#define dmp(x) cerr << __LINE__ << " " << #x << " " << x << endl
#else
#define dmp(x) void(0)
#endif
template <class t, class u>
void chmax(t &a, u b)
{
if (a < b... | a.cc:28:12: error: 'vector' does not name a type
28 | using vc = vector<t>;
| ^~~~~~
a.cc:30:13: error: 'vc' does not name a type
30 | using vvc = vc<vc<t>>;
| ^~
a.cc:32:12: error: 'vc' does not name a type
32 | using vi = vc<int>;
| ^~
a.cc: In function 'in... |
s263070813 | p03844 | C++ | #include<bits/stdc++.h>
using nameapace std;
int main(){
int A,B;
char c;
cin>>A>>c>>B;
if(c=='+'){cout<<A+B<<endl;}
else{cout<<A-B<<endl;}
return 0;
} | a.cc:2:7: error: expected nested-name-specifier before 'nameapace'
2 | using nameapace std;
| ^~~~~~~~~
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>>c>>B;
| ^~~
| std::cin
In file included from /usr/incl... |
s908786530 | p03844 | C++ | #include<bits/stdc++.h>
using nameplace std;
int main(){
int A,B;
char c;
cin>>A>>c>>B;
if(c=='+'){cout<<A+B<<endl;}
else{cout<<A-B<<endl;}
return 0;
} | a.cc:2:7: error: expected nested-name-specifier before 'nameplace'
2 | using nameplace std;
| ^~~~~~~~~
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>>c>>B;
| ^~~
| std::cin
In file included from /usr/incl... |
s549126469 | p03844 | C++ | #include<bits/stdc++.h>
int main(){
int A,B;
char c;
cin>>A>>c>>B;
if(c=='+'){cout<<A+B<<endl;}
else{cout<<A-B<<endl;}
return 0;
} | a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
6 | cin>>A>>c>>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: '... |
s148671518 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(void) {
int A, B;
string op;
cin >> A >> op >> B;
if (op == '+') {
cout << A + B << endl;
} else {
cout << A - B << endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:8:16: 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... |
s395390417 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
string s;
int a,b;
cin >>a>>s>>b;
if (s=='+') {
cout<<a+b<<endl;
}
else{
cout<<a-b<<endl;
}
} | a.cc: In function 'int main()':
a.cc:9:8: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
9 | if (s=='+') {
| ~^~~~~
| | |
| | char
| std::string {aka std::__cxx11::basic_string<char>}
In file ... |
s516999788 | p03844 | C++ | #include <stdio.h>
#include <algorithm>
#include <assert.h>
#include <bitset>
#include <cmath>
#include <complex>
#include <deque>
#include <functional>
#include <iostream>
#include <limits.h>
#include <map>
#include <math.h>
#include <queue>
#include <deque>
#include <set>
#include <stdlib.h>
#include <string.h>
#incl... | a.cc:53:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
53 | main(){
| ^~~~
a.cc: In function 'int main()':
a.cc:55:17: error: 'C' was not declared in this scope
55 | char c;cin>>C;
| ^
|
s371187926 | p03844 | C++ | #include <bits / stdc ++。h>
名前空間stdを使用します。
int main(){
int a、b;
char op;
cin >> a >> op >> b;
if(op == '+'){
cout << a + b << endl;
}
そうしないと{
cout << a-b << endl;
}
| a.cc:1:10: fatal error: bits / stdc ++。h: No such file or directory
1 | #include <bits / stdc ++。h>
| ^~~~~~~~~~~~~~~~~~~
compilation terminated.
|
s393689650 | 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:17: error: 'B' was not declared in this scope
9 | cout << a + B << endl;
| ^
a.cc:13:2: error: expected '}' at end of input
13 | }
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s878370999 | p03844 | C | #include<stdio.h>
int main()
{
int a,b;
char s;
scanf("%d\n",&a);
scanf("%c",&s);
scanf("%d",&b);
if(s=='+')
 printf("%d\n",a+b);
else
 printf("%d\n",a-b);
return 0;
}
| main.c: In function 'main':
main.c:11:2: error: stray '#' in program
11 |  printf("%d\n",a+b);
| ^
main.c:11:1: error: lvalue required as unary '&' operand
11 |  printf("%d\n",a+b);
| ^
main.c:12:1: error: 'else' without a previous 'if'
12 | else
| ^~~~
main.c:13:2: error: stray '#... |
s135380017 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int a,b;
char s;
cin >> a >> s >> b
int answer = 0;
if( s == '+') {
answer = a + b;
} else {
answer = a - b;
}
cout << answer << endl;
}
| a.cc: In function 'int main()':
a.cc:7:21: error: expected ';' before 'int'
7 | cin >> a >> s >> b
| ^
| ;
8 |
9 | int answer = 0;
| ~~~
a.cc:11:4: error: 'answer' was not declared in this scope
11 | answer = a + b;
... |
s615131957 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int a,b;
char s;
cin >> a >> s >> b
int answer;
if( s == '+') {
answer = a + b;
} else {
answer = a - b;
}
cout << answer << endl;
}
| a.cc: In function 'int main()':
a.cc:7:21: error: expected ';' before 'int'
7 | cin >> a >> s >> b
| ^
| ;
8 |
9 | int answer;
| ~~~
a.cc:11:4: error: 'answer' was not declared in this scope
11 | answer = a + b;
| ... |
s706237506 | p03844 | C++ | #inclde <bits/stdc++.h>
using namespace std;
int main() {
int a,b;
char s;
cin >> a >> s >> b
int answer;
if( s == '+') {
answer = a + b;
} else {
answer = a - b;
}
cout << answer << endl;
} | a.cc:1:2: error: invalid preprocessing directive #inclde; did you mean #include?
1 | #inclde <bits/stdc++.h>
| ^~~~~~
| include
a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope
7 | cin >> a >> s >> b
| ^~~
a.cc:1:1: note: 'std::cin' is defined in head... |
s909411036 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int a,c;
string s;
cin >> a >> s >> c;
if(s[0] == '+')
cout << a + c << endl;
if(s[0] == '-')
cout << a - c << endl;
if(s == '*')
cout << a * c << endl;
if(s == '/')
cout << a / c << endl;
}
| a.cc: In function 'int main()':
a.cc:12:6: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
12 | if(s == '*')
| ~ ^~ ~~~
| | |
| | char
| std::string {aka std::__cxx11::basic_string<char>}
In file included... |
s821441055 | 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 << endl;
if(s == '-')
cout << a - c << endl;
if(s == '*')
cout << a * c << endl;
if(s == '/')
cout << a / c << endl;
}
| a.cc: In function 'int main()':
a.cc:8:6: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
8 | if(s == '+')
| ~ ^~ ~~~
| | |
| | char
| std::string {aka std::__cxx11::basic_string<char>}
In file included ... |
s006915194 | 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 << endl;
if(s == '-')
cout << a - c << endl;
if(s == '*')
cout << a * c << endl;
if(s == '/')
cout << a / c << endl;
}
| a.cc: In function 'int main()':
a.cc:8:6: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
8 | if(s == '+')
| ~ ^~ ~~~
| | |
| | char
| std::string {aka std::__cxx11::basic_string<char>}
In file included ... |
s923585214 | 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 << endl;
if(s == '-')
cout << a - c << endl;
if(s == '*')
cout << a * c << endl;
if(s == '/')
cout << a / c << endl;
} | a.cc: In function 'int main()':
a.cc:8:6: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
8 | if(s == '+')
| ~ ^~ ~~~
| | |
| | char
| std::string {aka std::__cxx11::basic_string<char>}
In file included ... |
s592696806 | p03844 | C++ | using namespace std ;
int main () {
int x,y,z;
char ope;
cin>>x;
cin>>ope;
cin>>y;
switch(ope)
{
case '+':
z=x+y;
cout<<z;
break;
case '-':
z=x-y;
cout<<z;
break;
}
return 0 ;
}
| a.cc: In function 'int main()':
a.cc:6:4: error: 'cin' was not declared in this scope
6 | cin>>x;
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 | using namespace std ;
a.cc:14:9: error: 'cout... |
s532437396 | 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:8: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
7 | if(op=='+'){
| ~~^~~~~
| | |
| | char
| std::string {aka std::__cxx11::basic_string<char>}
In file in... |
s886863036 | p03844 | Java | /*
ID: andy.sc1
LANG: JAVA
TASK: addsub
*/
// Imports
import java.util.*;
import java.io.*;
public class addsub {
/**
* @param args the command line arguments
* @throws IOException, FileNotFoundException
*/
public static void main(String[] args) throws IOException, FileNotFoundException {
... | Main.java:11: error: class addsub is public, should be declared in a file named addsub.java
public class addsub {
^
1 error
|
s952076616 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int A,B;
char s;
cin >> A >> s >> B;
if(s == "+"){
A += B;
}
if(s == "-"){
A -= B;
}
cout << A << endl;;
} | a.cc: In function 'int main()':
a.cc:8:8: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
8 | if(s == "+"){
| ~~^~~~~~
a.cc:11:8: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
11 | if(s == "-"){
| ~~^~~~~~
|
s498516169 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int A, B;
string s;
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: 'op' was not declared in this scope
7 | cin >> A >> op >> B;
| ^~
|
s310147399 | p03844 | C | #include<stdio.h>
int main(){
long long A,B,SUM;
char op;
scanf("%lld %c %lld",&A,&op,&B);
if(op == '+'){
SUM = A + B;
}else if(op == '-'){
SUM = A - B;
}else if(op == '*'){
SUM = A * B;
}else if(op == '/'){
if(B == 0){
printf("B not is zero");
... | main.c: In function 'main':
main.c:15:13: error: 'return0' undeclared (first use in this function)
15 | return0;
| ^~~~~~~
main.c:15:13: note: each undeclared identifier is reported only once for each function it appears in
|
s506776982 | p03844 | C++ | #include"bits/stdc++.h"
#include<boost/multi_array.hpp>
#include<boost/optional.hpp>
#include<boost/range/irange.hpp>
#include<boost/range/algorithm.hpp>
#include<boost/range/adaptors.hpp>
using namespace std;
namespace adaptor = boost::adaptors;
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep3(i,m,n) for(i... | a.cc:2:9: fatal error: boost/multi_array.hpp: No such file or directory
2 | #include<boost/multi_array.hpp>
| ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
|
s074320712 | p03844 | C++ | #include"bits/stdc++.h"
#include<boost/multi_array.hpp>
#include<boost/optional.hpp>
#include<boost/range/irange.hpp>
#include<boost/range/algorithm.hpp>
#include<boost/range/adaptors.hpp>
using namespace std;
namespace adaptor = boost::adaptors;
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep3(i,m,n) for(i... | a.cc:2:9: fatal error: boost/multi_array.hpp: No such file or directory
2 | #include<boost/multi_array.hpp>
| ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
|
s245367450 | p03844 | C++ | #include <iostream >
using namespace std ;
int main (){
int x;
int z ;
char o;
cin >>x>>o>>z;
if (o=='+'){
cout << x+z;
}
else if (o=='-'){
cout << x-z;
}
return 0;
}
| a.cc:1:10: fatal error: iostream : No such file or directory
1 | #include <iostream >
| ^~~~~~~~~~~
compilation terminated.
|
s844950559 | p03844 | C++ |
int main() {
int a,b;
string op;
cin >> a >> op >> b;
if (op == "+") {
cout << a + b << endl;
} else if(op == "-") {
cout << a - b << endl;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:5:3: error: 'string' was not declared in this scope
5 | string op;
| ^~~~~~
a.cc:6:3: error: 'cin' was not declared in this scope
6 | cin >> a >> op >> b;
| ^~~
a.cc:6:15: error: 'op' was not declared in this scope
6 | cin >> a >> op >> b;
| ... |
s078154420 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int a, c;
char b;
cin >> a >> b >> c;
if ( b == '+' ) {
a += c
}
else {
a -=c
}
cout << a << endl;
} | a.cc: In function 'int main()':
a.cc:9:11: error: expected ';' before '}' token
9 | a += c
| ^
| ;
10 | }
| ~
a.cc:13:10: error: expected ';' before '}' token
13 | a -=c
| ^
| ;
14 | }
| ~
|
s589063280 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int A, B;
string OP;
cin >> A >> OP >> B;
int result;
if (OP == '+'){
result = A + B;
}else{
result = A - B;
}
cout << result << endl;
} | a.cc: In function 'int main()':
a.cc:11:10: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
11 | if (OP == '+'){
| ~~ ^~ ~~~
| | |
| | char
| std::string {aka std::__cxx11::basic_string<ch... |
s178674740 | p03844 | C++ | (defun solve (a b c)
(if (equal b '-)
(- a b)
(+ a b)))
(print (solve (read) (read) (read)) | a.cc:2:22: warning: missing terminating ' character
2 | (if (equal b '-)
| ^
a.cc:2:22: error: missing terminating ' character
2 | (if (equal b '-)
| ^~~
a.cc:1:7: error: expected ')' before 'solve'
1 | (defun solve (a b c)
| ~ ... |
s545393388 | p03844 | C++ | #include <iostream>
#include <vector>
#include<algorithm>
#include<math.h>
#include<iomanip>
#include <set>
#define ff(i,m,n) for(int i=m;i<n;i++)
#define i64 int64_t
using namespace std;
int main() {
int a, b;
cin >>a
char c;
cin >> c >> b;
if (c == '+') {
cout << a + b << endl;
return 0;
}
cout << a - ... | a.cc: In function 'int main()':
a.cc:14:16: error: expected ';' before 'char'
14 | cin >>a
| ^
| ;
15 | char c;
| ~~~~
a.cc:16:16: error: 'c' was not declared in this scope
16 | cin >> c >> b;
| ^
|
s501791689 | p03844 | C++ | #include<stdio.h>
#include<string.h>
int main(){
char a[1];
int b[2];
int c;
scanf("%d %s %d",&b[0],&a[0],&b[1]);
if(a =='+'){
c=b[0]+b[1];
printf("%d",c);
}
else if(a =='-'){
c=b[0]-b[1];
printf("%d",c);
}
return 0;
} | a.cc: In function 'int main()':
a.cc:8:14: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
8 | if(a =='+'){
| ~~^~~~~
a.cc:12:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
12 | else if(a =='-'){
| ... |
s226694720 | p03844 | C++ | #include<stdio.h>
#include<string.h>
int main(){
char a[1];
int b[2];
int c;
scanf("%d %s %d",&b[0],&a[0],&b[1]);
if(a =='+'){
c=b[0]+b[1];
}
else if(a =='-'){
c=b[0]-b[1];
}
printf("%d",c);
return 0;
} | a.cc: In function 'int main()':
a.cc:8:14: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
8 | if(a =='+'){
| ~~^~~~~
a.cc:11:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
11 | else if(a =='-'){
| ... |
s804298710 | p03844 | C++ | ts/stdc++.h>
using namespace std;
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:1:1: error: 'ts' does not name a type
1 | ts/stdc++.h>
| ^~
a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope
7 | cin >> A >> op >> B;
| ^~~
a.cc:11:3: error: 'cout' was not declared in this scope
11 | cout<<A + B<<endl;
| ^~~~
a.cc:11:16: er... |
s770203384 | 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:11:12: error: expected '}' at end of input
11 | return 0;
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s789874316 | p03844 | C++ | #include<iostream>
using namespace std;
int main(){
int A, B;
ch op;
cin >> A >> op >> B;
if (op=='+') cout << A + B;
else cout << A - B;
return 0;
} | a.cc: In function 'int main()':
a.cc:6:3: error: 'ch' was not declared in this scope
6 | ch op;
| ^~
a.cc:7:15: error: 'op' was not declared in this scope
7 | cin >> A >> op >> B;
| ^~
|
s707715511 | 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:10: 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<ch... |
s589961050 | p03844 | Java |
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int N = scanner.nextInt();
int[] A = new int[N];
for (int i = 0; i < N; i++) {
A[scanner.nextInt()]++;
}
if (N % 2 == 1 && A[0] != 1) {
Sys... | Main.java:5: error: cannot find symbol
Scanner scanner = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:5: error: cannot find symbol
Scanner scanner = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
2 ... |
s353517624 | p03844 | C++ | #include <iostream>
int main(){int a,b,char c;std::cin>>a>>c>>b;std::cout<<(c=='+'?a+b:a-b);} | a.cc: In function 'int main()':
a.cc:2:20: error: expected unqualified-id before 'char'
2 | int main(){int a,b,char c;std::cin>>a>>c>>b;std::cout<<(c=='+'?a+b:a-b);}
| ^~~~
a.cc:2:40: error: 'c' was not declared in this scope
2 | int main(){int a,b,char c;std::cin>>a>>c>>b;std::cout<<(c... |
s161141580 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int a, b;
char op;
cin >> a >> op >> b;
if (op == ‘+’) cout << a + b;
else cout << a - b;
cout << ‘\n’;
}
| a.cc:8:13: error: extended character ‘ is not valid in an identifier
8 | if (op == ‘+’) cout << a + b;
| ^
a.cc:8:15: error: extended character ’ is not valid in an identifier
8 | if (op == ‘+’) cout << a + b;
| ^
a.cc:10:11: error: extended character ‘ is not valid in ... |
s771157899 | p03844 | C++ | #include <bits/stdc++.h>
using namespace ste;
int main() {
int a, b;
char op;
cin >> a >> op >> b;
if (op == ‘+’) cout << a + b;
else cout << a - b;
cout << ‘\n’;
} | a.cc:8:13: error: extended character ‘ is not valid in an identifier
8 | if (op == ‘+’) cout << a + b;
| ^
a.cc:8:15: error: extended character ’ is not valid in an identifier
8 | if (op == ‘+’) cout << a + b;
| ^
a.cc:10:11: error: extended character ‘ is not valid in ... |
s229794080 | p03844 | C++ | #include<stdio.h>
int main(void)
{
int s;
cin >>s;
cout << s;
} | a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope
5 | cin >>s;
| ^~~
a.cc:6:3: error: 'cout' was not declared in this scope
6 | cout << s;
| ^~~~
|
s995200400 | p03844 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int a,b;
string op;
cin >> a >> op >> b;
if (op == '+') cout << a + b << endl;
else cout << a - b << endl;
} | a.cc: In function 'int main()':
a.cc:8:10: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
8 | if (op == '+') cout << a + b << endl;
| ~~ ^~ ~~~
| | |
| | char
| std::string {aka std::__c... |
s066325482 | p03844 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int a,b;
string c;
cin >> a >> c >> b;
if (c == '+') cout << a + b << endl;
else (c == '-') cout << a - b << endl;
} | a.cc: In function 'int main()':
a.cc:8:9: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
8 | if (c == '+') cout << a + b << endl;
| ~ ^~ ~~~
| | |
| | char
| std::string {aka std::__cxx11:... |
s939131309 | 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 (op == '-') cout << a - b << endl;
} | a.cc: In function 'int main()':
a.cc:8:10: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
8 | if (op == '+') cout << a + b << endl;
| ~~ ^~ ~~~
| | |
| | char
| std::string {aka std::__c... |
s132901124 | 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 (op == "-"){
cout << A - B << endl;
}
} | a.cc: In function 'int main()':
a.cc:13:19: error: expected ';' before '{' token
13 | else (op == "-"){
| ^
| ;
a.cc:13:12: warning: ignoring return value of 'bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*) [with _CharT ... |
s271843718 | 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 (op == "-"){
cout << A - B << endl;
}
} | a.cc: In function 'int main()':
a.cc:13:19: error: expected ';' before '{' token
13 | else (op == "-"){
| ^
| ;
a.cc:13:12: warning: ignoring return value of 'bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*) [with _CharT ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.