submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s683319672
p03844
C
#include <stdio.h> #include <string.h> int main(void){ int A, 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); } else { printf("%s\n", "Invalid!") } return 0; }
main.c: In function 'main': main.c:9:22: error: invalid operands to binary + (have 'int *' and 'int *') 9 | printf("%d\n", &A+&B); | ~~^~~ | | | | | int * | int * main.c:13:31: error: expected ';' before '}' to...
s035123842
p03844
C
#include <stdio.h> #include <string.h> int main(void){ int A, 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); } else { printf("%s\n", "Invalid!") } return 0; }
main.c: In function 'main': main.c:13:31: error: expected ';' before '}' token 13 | printf("%s\n", "Invalid!") | ^ | ; 14 | } | ~
s508750997
p03844
C
#include <stdio.h> #include <string.h> int main(void){ int A, 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); } else { printf("%s\n", "Invalid!") } return 0; }
main.c: In function 'main': main.c:9:22: error: invalid operands to binary + (have 'int *' and 'int *') 9 | printf("%d\n", &A+&B); | ~~^~~ | | | | | int * | int * main.c:13:31: error: expected ';' before '}' to...
s862393336
p03844
C
#include<stdio.h> 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); else printf("Error"); return 0; }
main.c: In function 'main': main.c:7:29: error: 'a' undeclared (first use in this function) 7 | printf("%d",a+b); | ^ main.c:7:29: note: each undeclared identifier is reported only once for each function it appears in main.c:7:31: error: 'b' undeclared (first use in...
s156487165
p03844
C++
#include <bits/stdc++.h> using namespace std; int min() { int a,b; char s; cin>>a>>s>>b; if(s=='+') cout<<a+b; else cout<<a-b; }
a.cc: In function 'int min()': a.cc:13:1: warning: no return statement in function returning non-void [-Wreturn-type] 13 | } | ^ /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit...
s845384275
p03844
C++
1 + 2
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 1 + 2 | ^
s708105981
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.equals("+") ? a+b : a-b); } }
Main.java:1: error: ';' expected import java.util*; ^ 1 error
s796613547
p03844
C++
#include <bits/stdc++.h> using namespace std; int main() { int A; string S; int B; cin >> A >> S >> B; if(S == '+'){ cout << A + B << endl; } if(S == '-'){ 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 fil...
s377164798
p03844
C++
a, op, b = input().split() if op == "+": print(int(a) + int(b)) else: print(int(a) - int(b))
a.cc:1:1: error: 'a' does not name a type 1 | a, op, b = input().split() | ^
s696871656
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; } }
a.cc: In function 'int main()': a.cc:9:6: error: 'c' was not declared in this scope 9 | if(c == '+'){ | ^
s048490123
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 ; return 0; }
a.cc: In function 'int main()': a.cc:7:7: error: expected primary-expression before '>' token 7 | cin > > a >> op >> b ; | ^ a.cc:7:11: error: no match for 'operator>>' (operand types are 'int' and 'std::string' {aka 'std::__cxx11::basic_string<char>'}) 7 | cin > > a >> op >> b ; | ~ ^...
s707162693
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 | ...
s102995778
p03844
C++
//#define _GLIBCXX_DEBUG #include <bits/stdc++.h> #include <algorithm> #define rep(i,n) for(int i=0;i<(n);++i) #define all(a) (a).begin(),(a).end() using namespace std; using Graph = vector<vector<int>>; typedef long long ll; const int mod= 1e+9+7; int main(){ ll a,b; string s; cin>>a>>s>>b; if(s=='+')cout...
a.cc: In function 'int main()': a.cc:14:9: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char') 14 | if(s=='+')cout<<a+b<<endl; | ~^~~~~ | | | | | char | std::string {aka std::__cxx11::basic_st...
s636798103
p03844
C++
//#define _GLIBCXX_DEBUG #include <bits/stdc++.h> #include <algorithm> #define rep(i,n) for(int i=0;i<(n);++i) #define all(a) (a).begin(),(a).end() using namespace std; using Graph = vector<vector<int>>; typedef long long ll; const int mod= 1e+9+7; int main(){ ll a,b; string s; cin>>a>>s>>b; if(s=='+')cout...
a.cc: In function 'int main()': a.cc:14:9: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char') 14 | if(s=='+')cout<<a+b<<endl; | ~^~~~~ | | | | | char | std::string {aka std::__cxx11::basic_st...
s520957925
p03844
C++
#include <bits/stdc++.h> using namespace std; int main() { int a, b; string op; cin << a << op << b; int ans; if (op == "+") ans = a + b; else if (op == "-") ans = a - b; cout << ans << endl; }
a.cc: In function 'int main()': a.cc:7:7: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int') 7 | cin << a << op << b; | ~~~ ^~ ~ | | | | | int | std::istream {aka std::basic_istream<char>} a.cc:7:7: note: candida...
s800741912
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:1:9: error: #include expects "FILENAME" or <FILENAME> 1 | #include(iostream) | ^ a.cc: In function 'int main()': a.cc:5:3: error: 'string' was not declared in this scope 5 | string b; | ^~~~~~ a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by...
s687409370
p03844
C++
#include(iostream) using namespace std; int main(){ int a,c; char b; cin >> a >> b >> c; if(b=="+") { cout << a+c << endl; } else{ cout << a-c << endl;; } }
a.cc:1:9: error: #include expects "FILENAME" or <FILENAME> 1 | #include(iostream) | ^ a.cc: In function 'int main()': a.cc:6:3: error: 'cin' was not declared in this scope 6 | cin >> a >> b >> c; | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable...
s801199716
p03844
C++
#include(iostream) using namespace std; int main(){ int a,c; string b; if(b=="+") { cout << a+c << endl; } else{ cout << a-c << endl;; } }
a.cc:1:9: error: #include expects "FILENAME" or <FILENAME> 1 | #include(iostream) | ^ a.cc: In function 'int main()': a.cc:5:3: error: 'string' was not declared in this scope 5 | string b; | ^~~~~~ a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by...
s334234502
p03844
C++
#include(iostream) using namespace std; int main(){ int a,c; char b; if(b=="+") { cout << a+c << endl; } else{ cout << a-c << endl;; } }
a.cc:1:9: error: #include expects "FILENAME" or <FILENAME> 1 | #include(iostream) | ^ a.cc: In function 'int main()': a.cc:6:7: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 6 | if(b=="+") | ~^~~~~ a.cc:8:5: error: 'cout' was not declared in this scope ...
s797826756
p03844
C++
#include <bits/stdc++.h> using namespace std; int main() { int a,c; string b; cin>>a>>b>>c; if(b=="+"){ cout<<a+b<<endl; } else if (b=="-") { cout<<a-b<<endl; } else if(b=="*"){ cout<<a*b<<endl; } else if(b=="/"){ cout<<a/b<<endl; } }
a.cc: In function 'int main()': a.cc:11:12: error: no match for 'operator+' (operand types are 'int' and 'std::string' {aka 'std::__cxx11::basic_string<char>'}) 11 | cout<<a+b<<endl; | ~^~ | | | | | std::string {aka std::__cxx11::basic_string<char>} | ...
s456226368
p03844
C++
#include <bits/stdc++.h> using namespace std; int main() { int a, c; string b; cin >> a >> b >> c; if(b == "+") { cout << a + b << endl; } else { cout << a - b << endl; } return 0; }
a.cc: In function 'int main()': a.cc:8:15: error: no match for 'operator+' (operand types are 'int' and 'std::string' {aka 'std::__cxx11::basic_string<char>'}) 8 | cout << a + b << endl; | ~ ^ ~ | | | | int std::string {aka std::__cxx11::basic_string<char>...
s782892849
p03844
C++
##include <bits/stdc++.h> using namespace std; int main(int argc, char const *argv[]) { int A, B, answer; char op; std::cin >> A >> B >> op; if (op='+') { answer == A + B; } else{ answer == A - B; } std::cout << answer << '\n'; return 0; }
a.cc:1:1: error: stray '##' in program 1 | ##include <bits/stdc++.h> | ^~ a.cc:1:3: error: 'include' does not name a type 1 | ##include <bits/stdc++.h> | ^~~~~~~ a.cc: In function 'int main(int, const char**)': a.cc:7:8: error: 'cin' is not a member of 'std' 7 | std::cin >> A >> B >> op; ...
s016094832
p03844
C++
##include <bits/stdc++.h> using namespace std; int main(int argc, char const *argv[]) { int A, B, answer; char op; std::cin >> A >> B >> op; if (op='+') { answer = A + B; } else{ answer = A - B; } std::cout << answer << '\n'; return 0; }
a.cc:1:1: error: stray '##' in program 1 | ##include <bits/stdc++.h> | ^~ a.cc:1:3: error: 'include' does not name a type 1 | ##include <bits/stdc++.h> | ^~~~~~~ a.cc: In function 'int main(int, const char**)': a.cc:7:8: error: 'cin' is not a member of 'std' 7 | std::cin >> A >> B >> op; ...
s842631731
p03844
C++
#include <bits/stdc++.h> using namespace std; int main() { int a, b; char x; scanf("%d%d%c",&a,&b,&x); cout << a x b << endl; return 0; }
a.cc: In function 'int main()': a.cc:11:12: error: expected ';' before 'x' 11 | cout << a x b << endl; | ^~ | ;
s325945179
p03844
C++
#include <bits/stdc++.h> using namespace std; int main() { int a, b; char x; cin >> a >> x >> b; cout << a x b << endl; return 0; }
a.cc: In function 'int main()': a.cc:10:12: error: expected ';' before 'x' 10 | cout << a x b << endl; | ^~ | ;
s321986864
p03844
C++
#include <bits/stdc++.h> using namespace std; int main() { int A,B; cin>>A>>B; char op; cin>>op; cout<<(A op B)<<endl; }
a.cc: In function 'int main()': a.cc:9:11: error: expected ')' before 'op' 9 | cout<<(A op B)<<endl; | ~ ^~~ | )
s991291319
p03844
C++
#include <bits/stdc++.h> using namespace std; int main() { int a; string op; int b; cin >> a >> op >> b; if (op == '+') { cout << a + b << endl; } else { cout << a - b << endl; } }
a.cc: In function 'int main()': a.cc:12:10: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char') 12 | if (op == '+') { | ~~ ^~ ~~~ | | | | | char | std::string {aka std::__cxx11::basic_string<c...
s721981028
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 ,, nedl; } if (op=="-"){ cout >> A-B << endl; } }
a.cc: In function 'int main()': a.cc:10:18: error: expected primary-expression before ',' token 10 | cout << A+B ,, nedl; | ^ a.cc:10:20: error: 'nedl' was not declared in this scope 10 | cout << A+B ,, nedl; | ^~~~ a.cc:13:10: error: no match for 'operator>...
s030907656
p03844
C++
#include<bits\stdc++.h> using namespace std; int main() { int a,c; char b; cin>>a>>b>>c; if(b=='+') cout<<a+c<<endl; else if(b=='-') cout<<a-c<<endl; return 0; }
a.cc:1:9: fatal error: bits\stdc++.h: No such file or directory 1 | #include<bits\stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s610970212
p03844
C++
#include <bits/stdc++.h> using namespace std; int main() { char a, b, c; cin >> a >> b >> c; int(a); int(c); if(b==('+')){ cout << a+c <<endl; } else { cout << a-c <<endl; } }
a.cc: In function 'int main()': a.cc:7:9: error: conflicting declaration 'int a' 7 | int(a); | ^ a.cc:5:7: note: previous declaration as 'char a' 5 | char a, b, c; | ^ a.cc:8:9: error: conflicting declaration 'int c' 8 | int(c); | ^ a.cc:5:13: note: previous ...
s277024016
p03844
C++
#include <bits/stdc++.h> using namespace std; int main() { int A,B; char op; cin >> A>>op>>B; if(op=='+'){sout>>A+B>>endl;} else{sout>>A-B>>endl;} }
a.cc: In function 'int main()': a.cc:8:13: error: 'sout' was not declared in this scope; did you mean 'stdout'? 8 | if(op=='+'){sout>>A+B>>endl;} | ^~~~ | stdout a.cc:9:8: error: 'sout' was not declared in this scope; did you mean 'stdout'? 9 | else{sout>>A-B>>endl;} ...
s227752213
p03844
C++
#include <bits/stdc++.h> using namespace std; int main() { int A, B char op; int ans = 0; cin >> A >> op >> B; if(op == '+'){ ans = A + B; } else{ ans = A - B; } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:6:3: error: expected initializer before 'char' 6 | char op; | ^~~~ a.cc:8:15: error: 'op' was not declared in this scope 8 | cin >> A >> op >> B; | ^~ a.cc:8:21: error: 'B' was not declared in this scope 8 | cin >> A >> op >> B; | ...
s509301928
p03844
C++
#include <bits/stdc++.h> using namespace std; int main() { char A, op, B; int ans = 0; cin >> A >> op >> B; if(op == '+'){ ans = stoi(A) + stoi(B); } else{ ans = stoi(A) - stoi(B); } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:10:15: error: no matching function for call to 'stoi(char&)' 10 | ans = stoi(A) + stoi(B); | ~~~~^~~ 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...
s670375605
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 if (op == '-'){ cout << A - B; }
a.cc: In function 'int main()': a.cc:13:4: error: expected '}' at end of input 13 | } | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^
s248858326
p03844
C++
#include <bits/stdc++.h> using namespace std; #define vi vector<int> #define all(v) v.begin(),v.end() #define ll long long int #define IOS ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); const ll MOD=1e9+7; void solve(){ int a,b; char c; cin >> a >> c >> b; if(c=='+')cout << a+b; ...
a.cc:26:1: error: expected unqualified-id before numeric constant 26 | 3 | ^
s849444441
p03844
C++
#include <bits/stdc++.h> using namespace std; #define vi vector<int> #define all(v) v.begin(),v.end() #define ll long long int #define IOS ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); const ll MOD=1e9+7; void solve(){ int a,b; cin >> a >> c >> b; char c; if(c=='+')cout << a+b; ...
a.cc: In function 'void solve()': a.cc:12:16: error: 'c' was not declared in this scope 12 | cin >> a >> c >> b; | ^
s976249818
p03844
C++
#include<bits/stdc++.h> using namespace std typedef long long int ll; int main(){ ll a,b; char x; cin>>a>>x>>b; if(x == '+'){ cout<<a+b<<"\n"; } else{ cout<<a-b<<"\n"; } return 0; }
a.cc:2:20: error: expected ';' before 'typedef' 2 | using namespace std | ^ | ; 3 | typedef long long int ll; | ~~~~~~~
s396687779
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; }
a.cc: In function 'int main()': a.cc:7:8: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 7 | if(op=="+") | ~~^~~~~
s957395310
p03844
C++
#include <bits/stdc++.h> using namespace std; int main(){ int A,B; char x cin >> A >> x >> B; if( x == '+' ){ cout << A+B << endl; } else{ cout << A-B << endl; } }
a.cc: In function 'int main()': a.cc:8:3: error: expected initializer before 'cin' 8 | cin >> A >> x >> B; | ^~~ a.cc:10:7: error: 'x' was not declared in this scope 10 | if( x == '+' ){ | ^
s569608501
p03844
C++
#include <bits/stdc++.h> int main() { int A, B; char op; cin >> A >> op >> B; if (op == '+') { cout << A+B; } else { cout << A-B; } }
a.cc: In function 'int main()': a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 5 | cin >> A >> op >> B; | ^~~ | std::cin In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146, from a.cc:1: /usr/include/c++/14/iostream:62:18: ...
s332167030
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: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<c...
s759740391
p03844
C++
#include <bits/stdc++.h> using namespace std; int main() { int x, y, sum; string op; if (op == '+'){ sum = x + y; } else if(op == '-'){ sum = x - y; } cout << sum << endl; }
a.cc: In function 'int main()': a.cc:8:14: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char') 8 | if (op == '+'){ | ~~ ^~ ~~~ | | | | | char | std::string {aka std::__cxx...
s142005680
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:10:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 10 | if (op == "+"){ | ~~~^~~~~~
s123517005
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; } if(op=='-'){ 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(op=='+'){ | ~~^~~~~ | | | | | char | std::string {aka std::__cxx11::basic_string<char>} In file in...
s783212811
p03844
C++
#include <bits/stdc++.h> using namespace std; int main() { int A, B; string S; cin A >> S >> B; if(S == "+") cout << A + B << endl; else cout << A - B << endl; return 0; }
a.cc: In function 'int main()': a.cc:7:6: error: expected ';' before 'A' 7 | cin A >> S >> B; | ^~ | ;
s945711794
p03844
C++
#include <bits/stdc++.h> using namespace std; int main() { int A, B; String S; cin A >> S >> B; if(S == "+") cout << A + B << endl; else cout << A - B << endl; return 0; }
a.cc: In function 'int main()': a.cc:6:3: error: 'String' was not declared in this scope 6 | String S; | ^~~~~~ a.cc:7:6: error: expected ';' before 'A' 7 | cin A >> S >> B; | ^~ | ; a.cc:9:6: error: 'S' was not declared in this scope 9 | if(S == "+") | ^
s558944354
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 if(op == '-') cout << A - B; }
a.cc: In function 'int main()': a.cc:10:15: 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::...
s769790485
p03844
C++
#include <iostream> using namespace std; int a, b; string op; cin>> a >> op >> b; if (op == "+") cout << a + b << endl; else cout << a - b << endl;
a.cc:7:1: error: 'cin' does not name a type 7 | cin>> a >> op >> b; | ^~~ a.cc:8:1: error: expected unqualified-id before 'if' 8 | if (op == "+") | ^~ a.cc:10:1: error: expected unqualified-id before 'else' 10 | else | ^~~~
s733657304
p03844
C
#include <iostream> using namespace std; int a, b; string op; cin>> a >> op >> b; if (op == "+") cout << a + b << endl; else cout << a - b << endl;
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s121477574
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:8: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char') 8 | if(c == '+'){ | ~ ^~ ~~~ | | | | | char | std::string {aka std::__cxx11::basic_string<char>} In fil...
s927363232
p03844
C++
#include <bits/stdc++.h> using namespace std; int main() { string op; int A, B; cin << A << op << B; if (op=="+"){ cout << A+B << endl; } else { cout << A-B << endl; } }
a.cc: In function 'int main()': a.cc:7:7: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int') 7 | cin << A << op << B; | ~~~ ^~ ~ | | | | | int | std::istream {aka std::basic_istream<char>} a.cc:7:7: note: candida...
s264799243
p03844
C++
#include <bits/stdc++.h> using namespace std; int main(){ int a,b,x; string op; cin>>a>>op>>b; if(op=="+") {x=a+b+} else { x=a-b; } cout<<x<<endl;}
a.cc: In function 'int main()': a.cc:8:10: error: expected primary-expression before '}' token 8 | {x=a+b+} | ^
s420993055
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; } return 0; }
a.cc: In function 'int main()': a.cc:10:9: 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>} I...
s517036498
p03844
C++
#include <iostream> #include <cmath> using namespace std; int main(){ int input1, input2; string op; cin>> input1; cin>> op; cin>> input2; if(op="+"){ cout<<input1+input2<< endl; } else(op="-"){ cout<<input1-input2<< endl; } return 0; }
a.cc: In function 'int main()': a.cc:13:10: error: could not convert 'op.std::__cxx11::basic_string<char>::operator=(((const char*)"+"))' from 'std::__cxx11::basic_string<char>' to 'bool' 13 | if(op="+"){ | ~~^~~~ | | | std::__cxx11::basic_string<char> a.cc:16:17: error...
s970457561
p03844
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main(){ ll a,b; string t; cin >> a >> t >> b; if(op=="+"){ cout << a+b << endl; } else{ cout << a-b << endl; } }
a.cc: In function 'int main()': a.cc:9:6: error: 'op' was not declared in this scope 9 | if(op=="+"){ | ^~
s003918978
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; } elseif ( op == '-' ){ cout << A-B << endl; } else { cout << "error" << endl; } }
a.cc: In function 'int main()': a.cc:11:5: error: 'elseif' was not declared in this scope 11 | } elseif ( op == '-' ){ | ^~~~~~ a.cc:13:5: error: 'else' without a previous 'if' 13 | } else { | ^~~~
s109436205
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; } elseif ( op == '++' ){ cout << A-B << endl; } else { cout << "error" << endl; } }
a.cc:11:20: warning: multi-character character constant [-Wmultichar] 11 | } elseif ( op == '++' ){ | ^~~~ a.cc: In function 'int main()': a.cc:11:5: error: 'elseif' was not declared in this scope 11 | } elseif ( op == '++' ){ | ^~~~~~ a.cc:13:5: error: 'else' without a prev...
s439469824
p03844
C++
#include <bits/stdc++.h> using namespace std; int main() { char p; int a, b; cin >> a >> p >> b; if( p == "+" ) cout << a+b << endl; else cout << a-b << endl; }
a.cc: In function 'int main()': a.cc:8:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 8 | if( p == "+" ) cout << a+b << endl; | ~~^~~~~~
s374221492
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; } if (op == -) { cout << a - b << endl; } }
a.cc: In function 'int main()': a.cc:10:14: error: expected primary-expression before ')' token 10 | if (op == +) { | ^ a.cc:13:14: error: expected primary-expression before ')' token 13 | if (op == -) { | ^
s493864651
p03844
C++
test
a.cc:1:1: error: 'test' does not name a type 1 | test | ^~~~
s312818572
p03844
C++
#include <bits/stdc++.h> using namespace std; int main() { int a, c; char b; cin >> a >> b >> c; if (b == '+'){ x = a + b; } if (b == '-'){ x = a - b; } cout << x <<endl; }
a.cc: In function 'int main()': a.cc:9:5: error: 'x' was not declared in this scope 9 | x = a + b; | ^ a.cc:12:5: error: 'x' was not declared in this scope 12 | x = a - b; | ^ a.cc:14:11: error: 'x' was not declared in this scope 14 | cout << x <<endl; | ^
s177572226
p03844
C++
#include <bits/stdc++.h> using namespace std; int main() { int a,b; string s; cin>>a>>s>>b; if(s=='+') cout<<a+b<<endl; else cout<<a-b<<endl; }
a.cc: In function 'int main()': a.cc:8:7: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char') 8 | if(s=='+') cout<<a+b<<endl; | ~^~~~~ | | | | | char | std::string {aka std::__cxx11::basic_string<char>...
s702771913
p03844
C++
#include <bits/stdc++.h> using namespace std; int main() { int a,c,d; string b; cin >> a >> b >> c; // ここにプログラムを追記 if (b == +) { d = a + c; } else { d = a - c; } cout << d << endl; }
a.cc: In function 'int main()': a.cc:10:13: error: expected primary-expression before ')' token 10 | if (b == +) { | ^
s820944301
p03844
C++
#include <bits/stdc++.h> using namespace std; int main() { int A,B; char C; cin >> A >> C >> B; if(C == '+'){ cout << A C B << endl; } else if(C == '-'){ cout << A C B << endl; } }
a.cc: In function 'int main()': a.cc:10:14: error: expected ';' before 'C' 10 | cout << A C B << endl; | ^~ | ; a.cc:13:14: error: expected ';' before 'C' 13 | cout << A C B << endl; | ^~ | ;
s794814006
p03844
C++
#include <bits/stdc++.h> using namespace std; int main() { int A,B; char op; cin >> A >> op >> B; if(op == '+'){ cout << A op B << endl; } else if(op == '-'){ cout << A op B << endl; } }
a.cc: In function 'int main()': a.cc:10:14: error: expected ';' before 'op' 10 | cout << A op B << endl; | ^~~ | ; a.cc:13:14: error: expected ';' before 'op' 13 | cout << A op B << endl; | ^~~ | ;
s161257782
p03844
C++
#include <bits/stdc++.h> using namespace std; int main() { int A,B; string op; cin >> A >> op >> B; if(op == "+"){ cout << A op B << endl; } else if(op == "-"){ cout << A op B << endl; } }
a.cc: In function 'int main()': a.cc:10:14: error: expected ';' before 'op' 10 | cout << A op B << endl; | ^~~ | ; a.cc:13:14: error: expected ';' before 'op' 13 | cout << A op B << endl; | ^~~ | ;
s439849530
p03844
C++
#include <bits/stdc++.h> using namespace std; int main() { int A,B; string op; cin >> A >> op >> B; if(op == "+"){ cout << A op B << endl; } else if(op == "-"){ cout << A op B << endl; } }
a.cc: In function 'int main()': a.cc:10:14: error: expected ';' before 'op' 10 | cout << A op B << endl; | ^~~ | ; a.cc:13:14: error: expected ';' before 'op' 13 | cout << A op B << endl; | ^~~ | ;
s712041770
p03844
C++
#include <bits/stdc++.h> using namespace std; int main () { int A, B; string o; cin >> A >> o >> B; if (o=="+") { cout >> A+B >> endl; } if (o=="-") { cout >> A-B >> endl; } }
a.cc: In function 'int main()': a.cc:10:10: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int') 10 | cout >> A+B >> endl; | ~~~~ ^~ ~~~ | | | | | int | std::ostream {aka std::basic_ostream<char>} a.cc...
s933523749
p03844
C++
#include<bits/stdc++.h> using namespace std; int main() { char op; cin>>op; int a,b; cin>>a>>b; switch(op){ case '+'; cout<<a+b; break; case'-' cout<<a-b; break; } return 0; }
a.cc: In function 'int main()': a.cc:10:25: error: expected ':' before ';' token 10 | case '+'; | ^ | : a.cc:13:24: error: expected ':' before 'cout' 13 | case'-' | ^ | ...
s001987731
p03844
C++
#include <bits/stdc++.h> using namespace std; int main(){ int A, C; string op std::cin >> A>> op>> C; if (op=="+") { std::cout << A+C << '\n';/* code */ } if (op=="-"){ std::cout << A-C << '\n'; } }
a.cc: In function 'int main()': a.cc:6:1: error: expected initializer before 'std' 6 | std::cin >> A>> op>> C; | ^~~ a.cc:7:5: error: 'op' was not declared in this scope 7 | if (op=="+") { | ^~ a.cc:10:5: error: 'op' was not declared in this scope 10 | if (op=="-"){ | ^~
s211528404
p03844
C++
#include <bits/stdc++.h> using namespace std; int main(){ int A, op, C; std::cin >> A>> op>> C; if (op=="+") { std::cout << A+C << '\n';/* code */ } if (op=="-"){ std::cout << A-C << '\n'; } }
a.cc: In function 'int main()': a.cc:6:7: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 6 | if (op=="+") { | ~~^~~~~ a.cc:9:7: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 9 | if (op=="-"){ | ~~^~~~~
s079968496
p03844
C++
#include <bits/stdc++.h> using namespace std; int main(){ int A, op, C; std::cin >> A>> op>> C; if (op=="+") { std::cout << A+C << '\n';/* code */ } if (op=="-") std::cout << A-C << '\n'; } }
a.cc: In function 'int main()': a.cc:6:7: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 6 | if (op=="+") { | ~~^~~~~ a.cc:9:7: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 9 | if (op=="-") | ~~^~~~~ a.cc: At global scope: a.cc:12...
s665805299
p03844
C++
#include <iostream> #include <string.h> using namespace std; int main() { long a,b; string s; cin>>a>>s>>b; if(s=='+')cout<<a+b<<endl; else cout<<a-b<<endl; return 0; }
a.cc: In function 'int main()': a.cc:9:9: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char') 9 | if(s=='+')cout<<a+b<<endl; | ~^~~~~ | | | | | char | std::string {aka std::__cxx11::basic_str...
s397572397
p03844
C++
#include <iostream> using namespace std; int main() { long a,b; string s; cin>>a>>s>>b; if(s=='+')cout<<a+b<<endl; else cout<<a-b<<endl; return 0; }
a.cc: In function 'int main()': a.cc:8:9: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char') 8 | if(s=='+')cout<<a+b<<endl; | ~^~~~~ | | | | | char | std::string {aka std::__cxx11::basic_str...
s834751738
p03844
C++
#include <bits/stdc++.h> #define rep(i,n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; int main() { int a, b; string s; cin >> a >> s >> b; if(s=='+') cout << a+b << endl; else cout << a-b << endl; return 0; }
a.cc: In function 'int main()': a.cc:11:7: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char') 11 | if(s=='+') cout << a+b << endl; | ~^~~~~ | | | | | char | std::string {aka std::__cxx11::basic_string<...
s144553984
p03844
C++
#include <bits/stdc++.h> 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:8:7: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char') 8 | if(b=='+'){ | ~^~~~~ | | | | | char | std::string {aka std::__cxx11::basic_string<char>} In file includ...
s592031698
p03844
C++
#include <bits/stdc++.h> using namespace std; int main() { int s1; string s2; int s3; cin>>s1>>s2>>s3; if(s2=='+'){ cout<<s1+s3<<endl; } else if(s2=='-'){ cout<<s1-s3<<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(s2=='+'){ | ~~^~~~~ | | | | | char | std::string {aka std::__cxx11::basic_string<char>} In file in...
s407778294
p03844
C++
#include <bits/stdc++.h> using namespace std; int main(){ int A,B; cin>>A>>B; string op; cin>>op; if(op=='+'){ 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(op=='+'){ | ~~^~~~~ | | | | | char | std::string {aka std::__cxx11::basic_string<char>} In file in...
s479480583
p03844
C++
#include <bits/stdc++.h> using namespace std; int main(){ int A,B; char op; cin A >> op >> B; if(op=='+'){ cout << A+B << endl; } else if(op=-'-'){ cout << A-B << endl; } }
a.cc: In function 'int main()': a.cc:7:6: error: expected ';' before 'A' 7 | cin A >> op >> B; | ^~ | ;
s402840264
p03844
C++
#include <bits/stdc++.h> using namespace std; int main(){ int a; cin >> a; char op; cin >> op; int b; cin >> b; if(op=="+"){ cout << a+b << endl; } else{ cout << a-b << endl; } }
a.cc: In function 'int main()': a.cc:12:8: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 12 | if(op=="+"){ | ~~^~~~~
s049041408
p03844
C++
#include <bits/sdc++.h> using namespace std; int main(){ int a; cin >> a; char op; cin >> op; int b; cin >> b; if(op=="+"){ cout << a+b << endl; } else{ cout << a-b << endl; } }
a.cc:1:10: fatal error: bits/sdc++.h: No such file or directory 1 | #include <bits/sdc++.h> | ^~~~~~~~~~~~~~ compilation terminated.
s562761365
p03844
C++
#include <bits/stdc++.h> using namespace std; int main() { int A, B; char op; cin >> A >> op >> B; if (op == '+') }
a.cc: In function 'int main()': a.cc:10:1: error: expected primary-expression before '}' token 10 | } | ^
s220229054
p03844
C++
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) 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:11:9: 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<char>} In f...
s403189445
p03844
C++
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main(){ int a,b; string ao; cin>>a>>ao>>b; if(ao=='+'){ cout<<a+b<<endl; } else{ cout<<a-b; } }
a.cc: In function 'int main()': a.cc:8:8: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char') 8 | if(ao=='+'){ | ~~^~~~~ | | | | | char | std::string {aka std::__cxx11::basic_string<char>} In file in...
s853914442
p03844
C++
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main(){ int a,b; string ao; cin>>a>>ao>>b; if(ao=='+'){ cout<<a+b<<endl; } else{ cout<<A-b; } }
a.cc: In function 'int main()': a.cc:8:8: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char') 8 | if(ao=='+'){ | ~~^~~~~ | | | | | char | std::string {aka std::__cxx11::basic_string<char>} In file in...
s409553937
p03844
C++
#include <bits/stdc++.h> using namespace std; #define ll long long int #define rep(i, n) for(int i = 0; i < n; i++) #define sort(v) sort((v).begin(), (v).end()) using vi = vector<int>; const int MOD = 1e9+7; bool IsPrime(int num){ if (num < 2) return false; else if (num == 2) return true; else if (num % ...
a.cc: In function 'int main()': a.cc:23:15: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char') 23 | if(op =='+') cout << A+B << endl; | ~~ ^~~~~ | | | | | char | std::...
s273852150
p03844
C++
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define PI 3.14159265358979323846 constexpr int INF = numeric_limits<int>::max() / 2; constexpr long long INFL = numeric_limits<long long>::max() / 2; constexpr int MOD = 1000000007; using Graph = vector<vector<int>>; ...
a.cc: In function 'int main()': a.cc:18:17: error: 'b' was not declared in this scope 18 | cin >>A>>x>>b; | ^
s095770070
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:9:10: 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> a.cc:13:18: erro...
s464458219
p03844
C++
#include <bits/stdc++.h> using namespace std; int main(){ char c; long long int a, b; cin >> a>> c >> b; if(C == '-')cout<<a-b<<"\n"; else cout<<a+b<<"\n"; return 0; }
a.cc: In function 'int main()': a.cc:7:8: error: 'C' was not declared in this scope 7 | if(C == '-')cout<<a-b<<"\n"; | ^
s360614507
p03844
C++
#include <bits/stdc++.h> using namespace std; int main(int argc, char**argv) { 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(int, char**)': a.cc:15:12: error: expected '}' at end of input 15 | return 0; | ^ a.cc:5:32: note: to match this '{' 5 | int main(int argc, char**argv) { | ^
s294665180
p03844
C++
#include <bits/stdc++.h> int main(int argc, char**argv) { 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(int, 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, from a.cc:1: /usr/include/c++/14/iostr...
s450008251
p03844
C++
#include <bits/stdc++.h int main(int, char**) { int a, b; char op; cin >> a >> op >> b; if (op == '+') a += b; else a -= b; cout << a << endl; return 0;
a.cc:1:24: error: missing terminating > character 1 | #include <bits/stdc++.h | ^ a.cc: In function 'int main(int, 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 f...
s017644234
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; if (op == "-") cout << A - B << endl; }
a.cc: In function 'int main()': a.cc:7:12: error: no match for 'operator<<' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'char') 7 | cin >> A << op << B; | ~~~~~~~~ ^~ ~~ | | | | | char | std::basic_istre...
s254204487
p03844
C++
#include <bits/stdc++.h> using namespace std; int main() { int A, B; char op; cin >> A << B << op; if (op == '+') cout << A + B <<endl; if (op == '-') cout << A - B << endl; }
a.cc: In function 'int main()': a.cc:7:12: error: no match for 'operator<<' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'int') 7 | cin >> A << B << op; | ~~~~~~~~ ^~ ~ | | | | | int | std::basic_istream<...
s897889570
p03844
C++
#include <bits/stdc++.h> using namespace std; int main(){ int A,B; string op; cin>>A>>op>>B; if(op=='+'){ cout<<A+B<<endl; } else{ cout<<A-B<<endl; } }
a.cc: In function 'int main()': a.cc:8:8: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char') 8 | if(op=='+'){ | ~~^~~~~ | | | | | char | std::string {aka std::__cxx11::basic_string<char>} In file in...
s032826322
p03844
C++
#include <bits/stdc++.h> using namespace std; int main(){ int A,B; string op; cin>>A>>B>>op; if(op=='+'){ cout<<A+B<<endl; } else{ cout<<A-B<<endl; } }
a.cc: In function 'int main()': a.cc:8:8: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char') 8 | if(op=='+'){ | ~~^~~~~ | | | | | char | std::string {aka std::__cxx11::basic_string<char>} In file in...
s602253421
p03844
C++
#include <bits/stdc++.h> using namespace std; using rep(i, n)=for(int i = 0; i < n; i++); using vi = vector<int>; int main() { int N; cin >> N; vi T(N); for (int i = 0; i < N; i++) cin >> T[i]; int M; cin >> M; vi P(M); vi X(M); for (int i = 0; i < M; i++) { cin >> P...
a.cc:4:7: error: expected nested-name-specifier before 'rep' 4 | using rep(i, n)=for(int i = 0; i < n; i++); | ^~~ a.cc:4:32: error: 'i' does not name a type 4 | using rep(i, n)=for(int i = 0; i < n; i++); | ^ a.cc:4:39: error: 'i' does not name a type 4 | us...
s257307131
p03844
C++
#include <bits/stdc++.h> using namespase 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:2:7: error: expected nested-name-specifier before 'namespase' 2 | using namespase std; | ^~~~~~~~~ a.cc: In function 'int main()': a.cc:6:9: error: 'string' was not declared in this scope 6 | string op; | ^~~~~~ a.cc:6:9: note: suggested alternatives: In file included from...
s560874508
p03844
Java
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int a = sc.nextInt(); String op = sc.next(); int b = sc.nextInt(); if(op.charAt(0)=="+"){ System.out.println(a+b); }else{ Syste...
Main.java:9: error: bad operand types for binary operator '==' if(op.charAt(0)=="+"){ ^ first type: char second type: String 1 error
s160596530
p03844
Java
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int a = sc.nextInt(); String op = sc.next(); int b = sc.nextInt(); if(op.charAt(o)=="+"){ System.out.println(a+b); }else{ Syste...
Main.java:9: error: cannot find symbol if(op.charAt(o)=="+"){ ^ symbol: variable o location: class Main 1 error