submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s877235004 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int A, B;
string op;
if (op == '+') {
cout << A + B << endl;
}
else {
cout << A - B << endl;
}
cin >> A >> op >> B;
}
| a.cc: In function 'int main()':
a.cc:8:10: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
8 | if (op == '+') {
| ~~ ^~ ~~~
| | |
| | char
| std::string {aka std::__cxx11::basic_string<ch... |
s922877240 | 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... |
s644495191 | p03844 | Java | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
String op = sc.next();
int b = sc.next();
if("+".equals(op)) {
System.out.println(a + b);
} else {
System.out.println(a - b)... | Main.java:8: error: incompatible types: String cannot be converted to int
int b = sc.next();
^
1 error
|
s448641965 | p03844 | C++ | A,op,C= input().split()
if op =="+":
res = int(A)+int(C)
elif op =="-":
res = int(A)-int(C)
print(res) | a.cc:1:1: error: 'A' does not name a type
1 | A,op,C= input().split()
| ^
|
s283050742 | p03844 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int A,B,x;
string op;
cin >> A;
cin >> op;
cin >> B;
if(op=='+')
x=A+B;
else
x=A-B;
cout << x << endl;
} | a.cc: In function 'int main()':
a.cc:10:8: 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 in... |
s595439514 | p03844 | C | int Question50A(void) {
int inputA = 0;
int inputB=0;
char inputOp[2];
int output = 0;
scanf("%d %s %d", &inputA, &inputOp[0], &inputB);
if (inputOp[0] == '+') output = inputA + inputB;
else if (inputOp[0] == '-') output = inputA - inputB;
else return 0;
printf("%d\n",output);
return 0;
} | main.c: In function 'Question50A':
main.c:6:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
6 | scanf("%d %s %d", &inputA, &inputOp[0], &inputB);
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
... |
s581425961 | p03844 | C | int Question50A(void) {
int inputA = 0;
int inputB=0;
char inputOp[2];
int output = 0;
scanf("%d %s %d", &inputA, &inputOp[0], &inputB);
if (inputOp[0] == '+') output = inputA + inputB;
else if (inputOp[0] == '-') output = inputA - inputB;
else return 1;
printf("%d\n",output);
return 0;
} | main.c: In function 'Question50A':
main.c:6:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
6 | scanf("%d %s %d", &inputA, &inputOp[0], &inputB);
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
... |
s800808550 | p03844 | C | int Question50A(void) {
int inputA = 0;
int inputB=0;
char inputOp[2];
int output = 0;
scanf("%d %s %d", &inputA, &inputOp[0], &inputB);
if (inputOp[0] == '+') output = inputA + inputB;
else if (inputOp[0] == '-') output = inputA - inputB;
else return 1;
printf("%d\n",output);
return 0;
} | main.c: In function 'Question50A':
main.c:6:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
6 | scanf("%d %s %d", &inputA, &inputOp[0], &inputB);
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
... |
s515083689 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
using ll = long long;
using P = pair<int, int>;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(), v.end()
#define sz(x) ((int) x.size())
#define pb push_back
#define mp make_pair
#define F first
#define S second
typede... | a.cc: In function 'int main()':
a.cc:23:7: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
23 | if(o=='+'){
| ~^~~~~
| | |
| | char
| std::string {aka std::__cxx11::basic_string<char>}
In file inclu... |
s461446630 | 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:18:1: error: expected declaration before '}' token
18 | }
| ^
|
s145005199 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int a, b, ans;
char op;
cin << a << op << b;
if(op == '+')
ans = a + b;
else
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... |
s185195941 | p03844 | C | #include<stdio.h>
int main()
{
int a,b,c;
scanf("%d %d,&a,&b);
if(a>=b){
c=a+b;
printf("%d",c);
}
else if(a<b){
c=a-b;
printf("%d",c);
}
}
return 0; | main.c: In function 'main':
main.c:5:9: warning: missing terminating " character
5 | scanf("%d %d,&a,&b);
| ^
main.c:5:9: error: missing terminating " character
5 | scanf("%d %d,&a,&b);
| ^~~~~~~~~~~~~~
main.c:6:9: error: expected expression before 'if'
6 | if(a>=b){
... |
s859973197 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int A,B;
cin >> A >> op >> B;
string op;
if ( op == "+" ) {
cout << A + B << endl;
}
if ( op == "-" ) {
cout << A - B << endl;
}
}
| a.cc: In function 'int main()':
a.cc:6:15: error: 'op' was not declared in this scope
6 | cin >> A >> op >> B;
| ^~
|
s023103453 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int a,b;
char op;
cin >> a >> op >> b;
if(op == "+"){
cout << a + b << endl;
}
else{
cout << a - b << endl;
}
}
| a.cc: In function 'int main()':
a.cc:8:9: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
8 | if(op == "+"){
| ~~~^~~~~~
|
s583210451 | p03844 | C++ | #include<bits/stdc++.h>
using namespace std;
int main() {
inta, b; char c; cin >> a >> c >> b;
cout << a + (c == '+' ? b : -b) << endl;
} | a.cc: In function 'int main()':
a.cc:4:3: error: 'inta' was not declared in this scope; did you mean 'int'?
4 | inta, b; char c; cin >> a >> c >> b;
| ^~~~
| int
a.cc:4:9: error: 'b' was not declared in this scope
4 | inta, b; char c; cin >> a >> c >> b;
| ^
a.cc:4:27: error: '... |
s526594001 | p03844 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int A,B;
cin>>A>>B;
string op;
if(op=='+'){
cout<<A+B<<endl;
}
if(op=='-'){
cout<<A-B<<endl;
}
if(op=="*"){
cout<<A*B<<endl;
}
if(op=="/"){
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... |
s020964856 | p03844 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int A,B;
cin>>A>>B;
string s;
if(op=='+'){
cout<<A+B<<endl;
}
if(op=='-'){
cout<<A-B<<endl;
}
if(op=="*"){
cout<<A*B<<endl;
}
if(op=="/"){
cout<<A/B<<endl;
}
} | a.cc: In function 'int main()':
a.cc:7:6: error: 'op' was not declared in this scope
7 | if(op=='+'){
| ^~
a.cc:10:6: error: 'op' was not declared in this scope
10 | if(op=='-'){
| ^~
a.cc:13:6: error: 'op' was not declared in this scope
13 | if(op=="*"){
| ^~
a.cc:16:6:... |
s642821128 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string a,op,b;
cin>>a>>op>>b;
int A=a,B=b;
if(op=="+")
cout<< A+B<<endl;
else if(op=="-")
cout<<A-B<<endl;
}
| a.cc: In function 'int main()':
a.cc:7:9: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'int' in initialization
7 | int A=a,B=b;
| ^
| |
| std::string {aka std::__cxx11::basic_string<char>}
a.cc:7:13: error: cannot convert 'std::string' {... |
s780693811 | 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:11:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
11 | else if (op == "-") {
| ~~~^~~~~~
|
s645291059 | 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;
}
else if (op == "-") {
cout << A - B << endl;
}
}
| a.cc: In function 'int main()':
a.cc:11:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
11 | else if (op == "-") {
| ~~~^~~~~~
|
s307051773 | p03844 | C++ | #include <iostream>
#include <string>
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;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:8:7: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int')
8 | cin << a << b << op;
| ~~~ ^~ ~
| | |
| | int
| std::istream {aka std::basic_istream<char>}
a.cc:8:7: note: candida... |
s471174669 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
strint op;
int a,b
cin >> a >> op >> b;
if(op == "+"){
cout<< a + b <<endl;
}
else if(op == "-"){
cout<< a - b <<endl;
}
}
| a.cc: In function 'int main()':
a.cc:5:4: error: 'strint' was not declared in this scope; did you mean 'strcat'?
5 | strint op;
| ^~~~~~
| strcat
a.cc:7:4: error: expected initializer before 'cin'
7 | cin >> a >> op >> b;
| ^~~
a.cc:9:6: error: 'op' was not declared in this scop... |
s092225463 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int A,B;
cin >> A >> op >> B;
if (op == "+")
cout << A + B <<endl;
if (op == "-") {
cout << A - B <<endl;
}
}
| a.cc: In function 'int main()':
a.cc:6:15: error: 'op' was not declared in this scope
6 | cin >> A >> op >> B;
| ^~
|
s072605000 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int A,B;
cin >> A >> op >> B;
if (op == +) cout << A + B <<endl;
if (op == -) cout << A - B <<endl;
}
| a.cc: In function 'int main()':
a.cc:6:15: error: 'op' was not declared in this scope
6 | cin >> A >> op >> B;
| ^~
a.cc:7:14: error: expected primary-expression before ')' token
7 | if (op == +) cout << A + B <<endl;
| ^
a.cc:8:14: error: expected primary-expression b... |
s198293514 | 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:9: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
10 | if (op=="+")
| ~~^~~~~
a.cc:12:9: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
12 | if (op=="-")
| ~~^~~~~
|
s786090335 | p03844 | Java | import java.util.Scanner;
public class Answer {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);//Scanner型の変数sにインスタンス化したメソッドを代入
int A = s.nextInt();
int B = s.nextInt();
String op = s.next();
System.out.println(op.equals("+") ? A + B : A - B);
s.close();
}
} | Main.java:2: error: class Answer is public, should be declared in a file named Answer.java
public class Answer {
^
1 error
|
s933447314 | p03844 | Java | import java.util.Scanner;
public class Answer {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);//Scanner型の変数sにインスタンス化したメソッドを代入
int A = s.nextInt();
int B = s.nextInt();
boolean op = true;
if (op) {
System.out.println(A + B);
} else {
System.out.println(A - B);
}
s... | Main.java:2: error: class Answer is public, should be declared in a file named Answer.java
public class Answer {
^
1 error
|
s761448317 | p03844 | C++ | #include<bits/stdc++.h>
using namespace std;
int a,b;
string op;
cin>>a>>op>>b;
int main()
{
if(op=="+")
cout<<a+b<<endl;
else
cout<<a-b<<endl;
}
| a.cc:5:1: error: 'cin' does not name a type
5 | cin>>a>>op>>b;
| ^~~
|
s199240161 | 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 | ... |
s444952468 | p03844 | C++ | #include <iostream>
#include<string.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:2: error: 'string' was not declared in this scope
5 | string op;
| ^~~~~~
a.cc:5:2: 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... |
s147498320 | p03844 | C++ | #include <iostream.h>
#include<string.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:1:10: fatal error: iostream.h: No such file or directory
1 | #include <iostream.h>
| ^~~~~~~~~~~~
compilation terminated.
|
s493025382 | p03844 | C++ | #include <iostream>
#include<string.h>
int main()
{ int A,B;
string op;
if(op=="+")
{
cout<<A+B<<endl;
}
else
{
cout<<A-B<<endl;
}
}
| a.cc: In function 'int main()':
a.cc:5:2: error: 'string' was not declared in this scope
5 | string op;
| ^~~~~~
a.cc:5:2: 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... |
s067295499 | p03844 | C++ | #include <iostream>
#include <bits/stdc++.h>
int main()
{ int A,B;
string op;
if(op=="+")
{
cout<<a+b<<endl;
}
else
{
cout<<a-b<<endl;
}
}
| a.cc: In function 'int main()':
a.cc:5:2: error: 'string' was not declared in this scope
5 | string op;
| ^~~~~~
a.cc:5:2: 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... |
s572209827 | p03844 | C++ | #include <iostream>
#include <bits/stdc++.h>
int main()
{ int A,B;
string op;
if(op==+)
{
cout<<a+b<<endl;
}
else
{
cout<<a-b<<endl;
}
}
| a.cc: In function 'int main()':
a.cc:5:2: error: 'string' was not declared in this scope
5 | string op;
| ^~~~~~
a.cc:5:2: 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... |
s329216045 | p03844 | C++ | using namespace std;
int main() {
int a, b;
cout << (a + b) << endl;
cout << (a - b) << endl;
} | a.cc: In function 'int main()':
a.cc:5:1: error: 'cout' was not declared in this scope
5 | cout << (a + b) << endl;
| ^~~~
a.cc:1:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 | using namespace std;
a.cc:5:20:... |
s810720245 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int A;
char op;
int B;
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;
| ^~~
| ;
|
s787928634 | 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:9:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
9 | if (op == "+") cout << A + B << endl;
| ~~~^~~~~~
a.cc:10:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
10 | else if (op == "-") cout << A... |
s710377200 | 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:9:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
9 | if (op == "+") cout << A + B << endl;
| ~~~^~~~~~
a.cc:10:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
10 | else if (op == "-") cout << A... |
s633891633 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int a,b;
char op;
if(op == '+')
cout << a+b << endl;
else
cout << a-b << end;
} | a.cc: In function 'int main()':
a.cc:11:17: error: no match for 'operator<<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>')
11 | cout << a-b << end;
| ~~~~~~~~~~~~^~~~~~
In file included from /usr/include/c++/14/istream:41,
from /usr/include/... |
s427772301 | p03844 | C++ | #include <bits/stdc++.h>
int main()
{
long int a,b;
char ch;
cin>>a>>ch>>b;
if(ch=='+')
cout<<a+b;
else
cout<<a-b;
} | a.cc: In function 'int main()':
a.cc:8:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
8 | cin>>a>>ch>>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: ... |
s192945501 | p03844 | C++ | #include <iostream>
#include <vector>
#include <string>
#include <math.h>
#include <algorithm>
#include <set>
#include <iomanip>
#include <stdio.h>
#include <sstream>
#include <string>
using namespace std;
int main(void){
int a, b;
string op;
cin>>a>>op>>b;
if(op=="+"){
cout<<a+b;<<endl;
}else{
cout<<... | a.cc: In function 'int main()':
a.cc:17:15: error: expected primary-expression before '<<' token
17 | cout<<a+b;<<endl;
| ^~
|
s344021029 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int a,b;
string c;
cin>>a>>c>>b;
cout<<(c=='+'? a+b:a-b)<<endl;
} | a.cc: In function 'int main()':
a.cc:9:17: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
9 | cout<<(c=='+'? a+b:a-b)<<endl;
| ~^~~~~
| | |
| | char
| ... |
s339125348 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int a,b;
stirng c;
cin>>a>>c>>b;
cout<<(c=='+'? a+b:a-b)<<endl;
} | a.cc: In function 'int main()':
a.cc:7:9: error: 'stirng' was not declared in this scope
7 | stirng c;
| ^~~~~~
a.cc:8:17: error: 'c' was not declared in this scope
8 | cin>>a>>c>>b;
| ^
|
s690214968 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string b;
int a,c;
cin>>a>>b>>c;
if(b=="+")cout<<a+c<<endl;
else cout<<a-c<,endl;
}
| a.cc: In function 'int main()':
a.cc:10:18: error: expected primary-expression before ',' token
10 | else cout<<a-c<,endl;
| ^
|
s384411274 | 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:6: 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 included fro... |
s770541592 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for( int i = 0; i < (int)(n); i++ )
#define ll long long int
int main( void )
{
ll A,B;
char op;
cin >> A >> op >> B;
if ( op == "+" )
{
cout << A + B << endl;
}
else if ( op == "-" )
{
cout << A - ... | a.cc: In function 'int main()':
a.cc:12:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
12 | if ( op == "+" )
| ~~~^~~~~~
a.cc:17:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
17 | else if ( op == "-" )
| ... |
s570376837 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for( int i = 0; i < (int)(n); i++ )
#define ll long long int
int main( void )
{
ll A,B;
char op;
cin A >> op >> B;
if ( op == "+" )
{
cout << A + B << endl;
}
else if ( op == "-" )
{
cout << A - B <... | a.cc: In function 'int main()':
a.cc:10:8: error: expected ';' before 'A'
10 | cin A >> op >> B;
| ^~
| ;
a.cc:12:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
12 | if ( op == "+" )
| ~~~^~~~~~
a.cc:17:18: error: ISO C++ forbids c... |
s836109399 | p03844 | C++ | #include<iostream>
using namespace std;
int main()
{
int a,b;
char s;
if(s=='+') cout<<a+b;
else cout<<a-b;
| a.cc: In function 'int main()':
a.cc:9:18: error: expected '}' at end of input
9 | else cout<<a-b;
| ^
a.cc:5:1: note: to match this '{'
5 | {
| ^
|
s573574761 | p03844 | C++ | #include<iostrem>
using namespace std;
int main()
{
int a,b;
char s;
if(s=='+') cout<<a+b;
else cout<<a-b; | a.cc:1:9: fatal error: iostrem: No such file or directory
1 | #include<iostrem>
| ^~~~~~~~~
compilation terminated.
|
s482957325 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int A;
cin >> A;
string op;
cin >> op;
int B;
cin >> B;
if(op=="+) {
cout << A+B << endl;}
else {
cout << A-B << endl;}
}
| a.cc:10:10: warning: missing terminating " character
10 | if(op=="+) {
| ^
a.cc:10:10: error: missing terminating " character
10 | if(op=="+) {
| ^~~~~
a.cc: In function 'int main()':
a.cc:10:8: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11:... |
s021889261 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int A;
cin >> A;
string 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:10:11: error: expected primary-expression before ';' token
10 | if(op==+;) {
| ^
a.cc:10:12: error: expected primary-expression before ')' token
10 | if(op==+;) {
| ^
|
s274435950 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int A;
cin >> A;
string 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:10:11: error: expected primary-expression before ')' token
10 | if(op==+) {
| ^
|
s570329893 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int A;
cin >> A;
string 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:10:8: 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 ... |
s663578822 | p03844 | C++ | #include <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:1:10: fatal error: stdc++.h: No such file or directory
1 | #include <stdc++.h>
| ^~~~~~~~~~
compilation terminated.
|
s173262534 | p03844 | C++ | include <bits/stdc++.h>
using namespace std;
int main()
{
int a, b;
char op;
cin >> a >> op >> b;
if (op == '+')
a += b;
else
a -= b;
cout << a << endl;
} | a.cc:1:1: error: 'include' does not name a type
1 | include <bits/stdc++.h>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:8:3: error: 'cin' was not declared in this scope
8 | cin >> a >> op >> b;
| ^~~
a.cc:15:3: error: 'cout' was not declared in this scope
15 | cout << a << endl;
| ... |
s843379199 | 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:7:5: error: expected initializer before 'cin'
7 | cin >> A >> op >> B ;
| ^~~
a.cc:8:6: error: 'op' was not declared in this scope
8 | if(op == "+"){
| ^~
a.cc:11:6: error: 'op' was not declared in this scope
11 | if(op=="-"){
| ^~
|
s428113166 | p03844 | C++ | #include <iostream>
using namespace std;
int main()
{
int a, b, op;
op = + or -;
cout << a op b;
} | a.cc: In function 'int main()':
a.cc:7:16: error: expected primary-expression before 'or' token
7 | op = + or -;
| ^~
a.cc:7:20: error: expected primary-expression before ';' token
7 | op = + or -;
| ^
a.cc:8:18: error: expected ';' before 'op'
8... |
s417269917 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int A,op,B;
cin >> A >> op >> B;
if (op == "+") {
cout << A+B << endl;
}
else {
cout << A-B << endl;
}
}
| a.cc: In function 'int main()':
a.cc:8:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
8 | if (op == "+") {
| ~~~^~~~~~
|
s981845304 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int A,op,B;
cin >> A >> op >> B;
if (op == +) {
cout << A+B << endl;
}
else {
cout << A-B << endl;
}
}
| a.cc: In function 'int main()':
a.cc:8:14: error: expected primary-expression before ')' token
8 | if (op == +) {
| ^
|
s523530879 | 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: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... |
s098270481 | p03844 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
long long int a,b;
char c;
cin<<a;
cin<<c;
cin<<b;
if(c=='+')
cout>>a+b;
else
cout>>a-b;
} | a.cc: In function 'int main()':
a.cc:8:4: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'long long int')
8 | cin<<a;
| ~~~^~~
| | |
| | long long int
| std::istream {aka std::basic_istream<char>}
a.cc:8:4: note: candidate: 'oper... |
s830210249 | p03844 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
long long int a,b;
char c;
cin<<a<<c<<b;
if(c=='+')
cout>>a+b;
else
cout>>a-b;
} | a.cc: In function 'int main()':
a.cc:8:4: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'long long int')
8 | cin<<a<<c<<b;
| ~~~^~~
| | |
| | long long int
| std::istream {aka std::basic_istream<char>}
a.cc:8:4: note: candidate:... |
s942409847 | p03844 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
long long long int a,b;
char c;
cin<<a<<c<<b;
if(c=='+')
cout>>a+b;
else
cout>>a-b;
} | a.cc: In function 'int main()':
a.cc:6:11: error: 'long long long' is too long for GCC
6 | long long long int a,b;
| ^~~~
a.cc:8:4: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'long long int')
8 | cin<<a<<c<<b;
| ~~~^~~
| | ... |
s275535471 | p03844 | C++ | #include<stdio.h>
int main(){
long long long int a,b;
char c;
cin<<a<<c<<b;
if(c=='+')
cout>>a+b;
else
cout>>a+b;
} | a.cc: In function 'int main()':
a.cc:4:11: error: 'long long long' is too long for GCC
4 | long long long int a,b;
| ^~~~
a.cc:6:1: error: 'cin' was not declared in this scope
6 | cin<<a<<c<<b;
| ^~~
a.cc:8:1: error: 'cout' was not declared in this scope
8 | cout>>a+b;
| ^~~~
a.c... |
s962722702 | p03844 | C | void add
{
int a,b,c,d,ch;
printf("enter the value for a");
scanf("%d",&a);
printf("enter the value for b");
scanf("%d",&b);
printf("enter your choice:\n 1->add\n2-->subtract\n");
scanf("%d",&ch);
switch(ch)
{
case 1:
c=a+b;
printf("%d",c);
break;
case 2:
d=a-b;
printf("%d",d)... | main.c:2:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
2 | {
| ^
|
s985626037 | p03844 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
int main()
{
int a,b;
cin>>a;
char ch;
cin>>op;
cin>>b;
int res=ch=='-'?a-b:a+b;
cout<<res<<"\n";
return 0;
} | a.cc: In function 'int main()':
a.cc:10:14: error: 'op' was not declared in this scope
10 | cin>>op;
| ^~
|
s175299670 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int A,B;
char op;
int ans;
cin >> A >> op >> B;
if(op=="+"){
ans = A+B;
} else {
ans = A-B;
}
}
| a.cc: In function 'int main()':
a.cc:9:8: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
9 | if(op=="+"){
| ~~^~~~~
|
s982112676 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int A,B;
char op;
int ans;
cin >> A >> op >> B;
if(op=="+"){
ans = A+B;
} else {
ans = A-B
}
} | a.cc: In function 'int main()':
a.cc:9:8: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
9 | if(op=="+"){
| ~~^~~~~
a.cc:12:14: error: expected ';' before '}' token
12 | ans = A-B
| ^
| ;
13 | }
| ~
|
s233004415 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
long long 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:9: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'long long int')
7 | cin <<a<<op<<b;
| ~~~ ^~~
| | |
| | long long int
| std::istream {aka std::basic_istream<char>}
a... |
s850166002 | 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:13:4: error: expected '}' at end of input
13 | }
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s044027617 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int A,B;
string op;
if(op=="+"){
cout<<A+B<< endl;
}
else{
cout<<A-B<< endl;
} | a.cc: In function 'int main()':
a.cc:12:4: error: expected '}' at end of input
12 | }
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s523752458 | p03844 | C++ | #include <bits/stdc++.h>
#define trace1(a) cout<<#a<<": "<<a<<endl
#define trace2(a,b) cout<<#a<<": "<<a<<" | ", trace1(b)
#define trace3(a,b,c) cout<<#a<<": "<<a<<" | ", trace2(b,c)
#define trace4(a,b,c,d) cout<<#a<<": "<<a<<" | ", trace3(b,c,d)
#define t... | a.cc: In function 'void _main()':
a.cc:70:3: error: expected initializer before 'cin'
70 | cin >> a >> op >> b;
| ^~~
a.cc:72:7: error: 'op' was not declared in this scope
72 | if (op == '+') ans += a+b; else ans += a-b;
| ^~
|
s391452925 | 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: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... |
s543937779 | p03844 | C++ | #include<iostream>
#include<stdio.h>
#include<vector>
#include<algorithm>
#include<set>
#include<string>
#include<map>
#include<string.h>
#include<complex>
#include<math.h>
#include<queue>
#include <functional>
#include<time.h>
#include <stack>
#include<iomanip>
using namespace std;
#define rep(i,a,n) for(int i=(a);i<(... | a.cc: In function 'int main()':
a.cc:214:3: error: 'in' was not declared in this scope; did you mean 'yn'?
214 | in>>a>>s>>b;
| ^~
| yn
|
s166808769 | p03844 | C++ | #include<iostream>
#include<stdio.h>
#include<vector>
#include<algorithm>
#include<set>
#include<string>
#include<map>
#include<string.h>
#include<complex>
#include<math.h>
#include<queue>
#include <functional>
#include<time.h>
#include <stack>
#include<iomanip>
using namespace std;
#define rep(i,a,n) for(int i=(a);i<(... | a.cc: In function 'int main()':
a.cc:214:3: error: 'in' was not declared in this scope; did you mean 'yn'?
214 | in>>a>>s>>b;
| ^~
| yn
|
s579389498 | p03844 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int m, n;
char x;
cin >> m >> x >> n;
if(x == '+'){
cout << m + n << '\n';
}
if(x == '-'){
cout << m - n << '\n'
}
} | a.cc: In function 'int main()':
a.cc:12:30: error: expected ';' before '}' token
12 | cout << m - n << '\n'
| ^
| ;
13 | }
| ~
|
s055035949 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int A , B;
string op;
cin >> A >> B >> op;
if(op == "+") {
cout << A op B << endl;
}
else if(op == "-") {
cout << A op B << endl;
}
} | a.cc: In function 'int main()':
a.cc:9:14: error: expected ';' before 'op'
9 | cout << A op B << endl;
| ^~~
| ;
a.cc:13:14: error: expected ';' before 'op'
13 | cout << A op B << endl;
| ^~~
| ;
|
s474379671 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int maina(){
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 maina()':
a.cc:15:1: warning: no return statement in function returning non-void [-Wreturn-type]
15 | }
| ^
/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 ex... |
s237189134 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int A, B;
char op,
cin >> A >> op >> B;
if (op == '+') {
cout << A + B << endl;
}
else {
cout << A - B << endl
}
} | a.cc: In function 'int main()':
a.cc:7:7: error: expected initializer before '>>' token
7 | cin >> A >> op >> B;
| ^~
a.cc:12:26: error: expected ';' before '}' token
12 | cout << A - B << endl
| ^
| ;
13 | }
| ~ ... |
s676360338 | p03844 | C | #include<stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
long long a, b,c;
char c;
scanf("%lld %c %lld", &a, &c, &b);
if(c=='+')
printf("%lld", a+b);
if (c == '-')
printf("%lld", a - b);
return 0;
}
| main.c: In function 'main':
main.c:7:14: error: conflicting types for 'c'; have 'char'
7 | char c;
| ^
main.c:6:24: note: previous declaration of 'c' with type 'long long int'
6 | long long a, b,c;
| ^
|
s452421163 | p03844 | C | #include<stdio.h>
int main()
{
int a,b;
char op;
cin>>a>>op>>b;
if(op=='+')
cout<<a+b<<endl;
else if(op=='-')
cout<<a-b<<endl;
return 0;
} | main.c: In function 'main':
main.c:6:9: error: 'cin' undeclared (first use in this function)
6 | cin>>a>>op>>b;
| ^~~
main.c:6:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:8:17: error: 'cout' undeclared (first use in this function)
8 | ... |
s368417577 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string x;
int a,b,c;
cin >> a,x,b;
if(x=='+'){
c = a + b;
}else if(x=='-'){
c= a - b;
}
cout << 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(x=='+'){
| ~^~~~~
| | |
| | char
| std::string {aka std::__cxx11::basic_string<char>}
In file includ... |
s789646684 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
char x;
long long int a,b,c;
cin >> a,x,b;
if(x=="+"){
c = a + b;
}else if(x=="-"){
c= a - b;
}
cout << c;
}
| a.cc: In function 'int main()':
a.cc:8:7: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
8 | if(x=="+"){
| ~^~~~~
a.cc:10:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
10 | }else if(x=="-"){
| ~^~~~~
|
s058660029 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string x;
long long int a,b,c;
cin >> a,x,b;
if(x=='+'){
c = a + b;
}else if(x=='-'){
c= a - b;
}
cout << c;
}
| 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(x=='+'){
| ~^~~~~
| | |
| | char
| std::string {aka std::__cxx11::basic_string<char>}
In file includ... |
s426117356 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string x;
long long int a,b,c;
cin >> a,x,b;
if(x="+"){
c = a + b;
}else if(x="-"){
c= a - b;
}
cout << c;
}
| a.cc: In function 'int main()':
a.cc:8:7: error: could not convert 'x.std::__cxx11::basic_string<char>::operator=(((const char*)"+"))' from 'std::__cxx11::basic_string<char>' to 'bool'
8 | if(x="+"){
| ~^~~~
| |
| std::__cxx11::basic_string<char>
a.cc:10:13: error: could not con... |
s941748688 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string x;
long long int a,b,c;
cin >> a,x,b;
if(x="+"){
c = a + b
}else if(x="-"){
c= a - b
}
cout << c;
}
| a.cc: In function 'int main()':
a.cc:8:7: error: could not convert 'x.std::__cxx11::basic_string<char>::operator=(((const char*)"+"))' from 'std::__cxx11::basic_string<char>' to 'bool'
8 | if(x="+"){
| ~^~~~
| |
| std::__cxx11::basic_string<char>
a.cc:9:14: error: expected ';' b... |
s751358332 | p03844 | C | #include <iostream>
int main()
{
long long int a, b, ans;
char op;
std::cin >> a >> op >> b;
if (op == '+') {
ans = a + b;
} else {
ans = a - b;
}
std::cout << ans << std::endl;
return 0;
}
| main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s068600357 | p03844 | C++ | #include <bits/stc++.h>
using namespace std;
int main()
{
int a ;
int b ;
char c;
scanf("%d %c %d",&a, &c, &b);
if(c == '+')
{
cout << a+b ;
}
else
{
cout << a-b ;
}
} | a.cc:1:10: fatal error: bits/stc++.h: No such file or directory
1 | #include <bits/stc++.h>
| ^~~~~~~~~~~~~~
compilation terminated.
|
s395830488 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int A, B;
string op;
cin >> A >> op >> B;
if (op == '+') {
cout << A + B;
} else {
cout << A - B;
}
} | a.cc: In function 'int main()':
a.cc:8:10: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
8 | if (op == '+') {
| ~~ ^~ ~~~
| | |
| | char
| std::string {aka std::__cxx11::basic_string<ch... |
s347508414 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int a, b;char o;cin >> a >> o >> b;
if (op == '+') cout << a + b << endl;
else cout << a - b << endl;
} | a.cc: In function 'int main()':
a.cc:5:7: error: 'op' was not declared in this scope; did you mean 'o'?
5 | if (op == '+') cout << a + b << endl;
| ^~
| o
|
s021231955 | p03844 | C++ | #include <iostream>
using namespace std
int main() {
int a, b;
char op;
cin >> a >> op >> b;
cout << op == "+" ? a+b : a-b << endl;
} | a.cc:2:20: error: expected ';' before 'int'
2 | using namespace std
| ^
| ;
3 |
4 | int main() {
| ~~~
a.cc: In function 'int main()':
a.cc:8:14: error: no match for 'operator==' (operand types are 'std::basic_ostream<char>' and 'cons... |
s391255771 | p03844 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
int main() {
int a,b;
char s='';
cin >>a>> s>>b;
if(s=='+')
cout<<a+b;
else
cout<a-b;
}
| a.cc:9:10: error: empty character constant
9 | char s='';
| ^~
a.cc: In function 'int main()':
a.cc:14:9: error: no match for 'operator<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int')
14 | cout<a-b;
| ~~~~^~~~
| | |
| | in... |
s543317936 | 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:7:4: error: extended character ‘ is not valid in an identifier
7 | if(‘+’==op){
| ^
a.cc:7:6: error: extended character ’ is not valid in an identifier
7 | if(‘+’==op){
| ^
a.cc: In function 'int main()':
a.cc:7:4: error: '\U00002018' was not declared in this scope
7 | if(‘+’==op){
... |
s769817700 | p03844 | C++ | #include <iostream>
using namespace std ;
int main()
{
int A , B ;
char x ;
cin >> A >> B ;
cin >> x ;
int subs = A - B ;
int adds = A + B ;
if (A >= 1 && B <= 10e9){
if (x == " + ")
cout << adds ;
if (x == " - ")
cout << subs ;
}
} | a.cc: In function 'int main()':
a.cc:12:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
12 | if (x == " + ")
| ~~^~~~~~~~
a.cc:14:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
14 | if (x == " - ")
| ... |
s976336423 | p03844 | C++ | int A , B ;
char x ;
cin >> A >> B >> x ;
if (A >= 1 && B <= 10^9){
if (x == "+")
cout << A+B ;
else if (x == "-")
cout << A-B ;
} | a.cc:3:5: error: 'cin' does not name a type
3 | cin >> A >> B >> x ;
| ^~~
a.cc:4:5: error: expected unqualified-id before 'if'
4 | if (A >= 1 && B <= 10^9){
| ^~
|
s841949896 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int A,B;
char op;
cin>>A>>op>>B;
cout<<(A+(op=='+'?1?-1)*B)<<endl;
} | a.cc: In function 'int main()':
a.cc:7:25: error: expected ':' before ')' token
7 | cout<<(A+(op=='+'?1?-1)*B)<<endl;
| ^
| :
a.cc:7:25: error: expected primary-expression before ')' token
a.cc:7:25: error: expected ':' before ')' token
7 | cout<<(... |
s795463495 | p03844 | C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX(a,b) (a > b) ? a : b
#define MIN(a,b) (a < b) ? a : b
const int inf = 1000000000; // 10^9
int main(){
int a,b;
char op;scanf("%d %c %d",&a,&op,&b);
if(op == '+')printf("%ld",a+b);
else printf("%d",a-b)
}
| main.c: In function 'main':
main.c:13:25: error: expected ';' before '}' token
13 | else printf("%d",a-b)
| ^
| ;
14 | }
| ~
|
s038405602 | 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;
}
} | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s157200862 | p03844 | C++ | #include <iostream>
using namespace std;
int main()
{
int A,B ;
cin >> A,B ;
int sum =A+B;
int subtraction A-B ;
cout << sum << endl;
cout << subtraction << endl;
return 0 ;
} | a.cc: In function 'int main()':
a.cc:8:19: error: expected initializer before 'A'
8 | int subtraction A-B ;
| ^
a.cc:10:11: error: 'subtraction' was not declared in this scope
10 | cout << subtraction << endl;
| ^~~~~~~~~~~
|
s926377196 | p03844 | C++ | #include <iostream>
using namesoace std ;
int main()
{
int A,B ;
cin>> A,B ;
int sum =A+B ;
int subtraction =A-B;
cout << sum <<endl;
cout << subtraction << endl;
return 0;
} | a.cc:2:7: error: expected nested-name-specifier before 'namesoace'
2 | using namesoace std ;
| ^~~~~~~~~
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,B ;
| ^~~
| std::cin
In file included from a.cc:1:
/u... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.