submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s358904682 | p03844 | C++ | #include <iostream>
#include <string>
using namespace std;
int main() {
int A, B;
string op;
cin >> A >> op >> B;
if (op == '+') { cout << A+B; }
else { cout << A-B; }
return 0;
} | a.cc: In function 'int main()':
a.cc:10:10: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
10 | if (op == '+') { cout << A+B; }
| ~~ ^~ ~~~
| | |
| | char
| std::string {aka std::__cxx11:... |
s945655102 | p03844 | C++ | #include<iostream>
using namespace std;
int main(){
int a,b;
char op;
cin >> a >> op >> b;
cout << (c=='+'? a+b:a-b) << endl;
} | a.cc: In function 'int main()':
a.cc:7:12: error: 'c' was not declared in this scope
7 | cout << (c=='+'? a+b:a-b) << endl;
| ^
|
s291922950 | p03844 | C | #include<bits/stdc++.h>
int main()
{
int a,b;
scanf("%d&d",&a,&b)
if(a>=1 b<=10)printf("%d",a+b)
else printf("no")
} | main.c:1:9: fatal error: bits/stdc++.h: No such file or directory
1 | #include<bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s070618781 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int A,B;
char c;
cin >> A>>c>>B;
if(c=='+')cout >>A+B>>endl;
else cout >>A-B>>endl;
}
| a.cc: In function 'int main()':
a.cc:8:18: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int')
8 | if(c=='+')cout >>A+B>>endl;
| ~~~~ ^~~~~
| | |
| | int
| std::ostream {a... |
s996550666 | p03844 | C++ | #include <iostreme>
using namespace std;
int main()
{
int a, b;
string s;
cin >> a >> s >> b;
if( s == "+" )
{
cout << a + b << endl;
}
else if( s == "-")
{
cout << a - b << endl;
}
else
{
cout << "Error" << endl;
}
return 0;
} | a.cc:1:10: fatal error: iostreme: No such file or directory
1 | #include <iostreme>
| ^~~~~~~~~~
compilation terminated.
|
s130685331 | p03844 | C++ | #include <iostream>
#include <vector>
#include <cstdio>
#include <string>
#include <algorithm>
using namespace std;
int main()
{
int a, b;
char op;
cin >> a >> op >> b;
if (op == '+') {
// printf("%d\n", a+b);
cout << a+b << "\n";
}else {
cout << a-b << "\n";
//printf("%d\n", a-b);
}
r... | a.cc:29:5: error: redefinition of 'int main()'
29 | int main()
| ^~~~
a.cc:8:5: note: 'int main()' previously defined here
8 | int main()
| ^~~~
|
s831568135 | p03844 | C++ | #include<bits/stdc++.h>
#include<string>
using namespace std;
int a, b;
string op;
int main(){
cin >> a >> op >> b;
if(op == '+') cout << a + b << endl;
else cout << a - b << endl;
} | a.cc: In function 'int main()':
a.cc:8:9: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
8 | if(op == '+') cout << a + b << endl;
| ~~ ^~ ~~~
| | |
| | char
| std::string {aka std::__cxx11::... |
s672777131 | p03844 | C++ | #include<cstdio>
int main(){
int A, B;
char op;
scanf("%d %c %d", &A,&op,&B);
if(op == '+') printf("%d\n", A+B);
if(op == '-') printf("%d\", A-B);
return 0;
} | a.cc:8:30: warning: missing terminating " character
8 | if(op == '-') printf("%d\", A-B);
| ^
a.cc:8:30: error: missing terminating " character
8 | if(op == '-') printf("%d\", A-B);
| ^~~~~~~~~~~~
a.cc: In function 'int main()... |
s636518949 | p03844 | C | #include<studio.h>
using namespace std;
map<int,int>q;
long long h,m;
char s;
int main()
{
scanf("%lld %c %lld",&h,&s,&m);
if(s=='+')
{
printf("%lld\n",h+m);
}
else
{
printf("%lld\n",h-m);
}
return 0;
} | main.c:1:9: fatal error: studio.h: No such file or directory
1 | #include<studio.h>
| ^~~~~~~~~~
compilation terminated.
|
s063201583 | p03844 | C++ | #include<stdio.h>
int main()
{
int A,B;
char op;
scanf("%d%c%d",&A,&op,&B);
printf("%d\n",A op B);
return 0;
} | a.cc: In function 'int main()':
a.cc:7:24: error: expected ')' before 'op'
7 | printf("%d\n",A op B);
| ~ ^~~
| )
|
s355666544 | p03844 | C++ | #include<stdio.h>
int main(){
int a,b;
char op;
scanf("%d%d",a,b);
printf("%d\n",a op b);
return 0;
} | a.cc: In function 'int main()':
a.cc:6:24: error: expected ')' before 'op'
6 | printf("%d\n",a op b);
| ~ ^~~
| )
|
s496354649 | p03844 | C++ | #include<stdio.h>
int main(){
int a,b;
char op;
scanf("%d%%d",a,b);
printf("%d\n",a op b);
return 0;
} | a.cc: In function 'int main()':
a.cc:6:24: error: expected ')' before 'op'
6 | printf("%d\n",a op b);
| ~ ^~~
| )
|
s468034115 | p03844 | C++ | #include<stdio.h>
int main(){
int a,b,op;
scanf("%d%%d",a,b);
printf("%d\n",a op b);
return 0;
} | a.cc: In function 'int main()':
a.cc:5:24: error: expected ')' before 'op'
5 | printf("%d\n",a op b);
| ~ ^~~
| )
|
s578863296 | p03844 | Java | import java.util.Scanner;
public class findSecond
{
public static void main(String[] args)
{
int A;
int B;
int C;
Scanner N = new Scanner(System.in);
A = N.nextInt();
B = N.nextInt();
C = A+B;
System.out.println( C);
{
}
}
}
| Main.java:3: error: class findSecond is public, should be declared in a file named findSecond.java
public class findSecond
^
1 error
|
s366279556 | p03844 | Java | import java.io.*;
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
str = sc.nextString();
int b = sc.nextInt();
if(str == "+") {
System.out.println(a + b);
} else{
System.out.prinln(a - b);
}
}
} | Main.java:7: error: cannot find symbol
str = sc.nextString();
^
symbol: variable str
location: class Main
Main.java:7: error: cannot find symbol
str = sc.nextString();
^
symbol: method nextString()
location: variable sc of type Scanner
Main.java:9: error: cannot find symbol
if(str == "+") {
^
s... |
s957518075 | p03844 | Java | import java.io.*;
import java.util.Scanner;
public class AddSubtract {
// scanner to read
final Scanner scan = new Scanner(System.in);
// variables
int A = scan.nextInt();
int B = scan.nextInt();
String op = scan.next();
//the works baby
if (op.equals("-")){
System.out.println(A-B);
}
System.... | Main.java:13: error: illegal start of type
if (op.equals("-")){
^
Main.java:13: error: <identifier> expected
if (op.equals("-")){
^
Main.java:13: error: illegal start of type
if (op.equals("-")){
^
Main.java:16: error: <identifier> expected
System.out.println(A+B);
... |
s654548925 | p03844 | C++ | #include<cstdio>
int main()
{
int a,c;
char b,n,m;
int sum;
while(scanf("%d",&a)!=EOF)
{
scanf("%c",&m);
scanf("%c",&b);
scanf("%c",&n);
scanf("%d",&c);
if(b==43)
{
sum=a+c;
printf("%d\n",sum);
}
else
{
sum=a-c;
printf("%d\n",sum);
}
}
return 0; | a.cc: In function 'int main()':
a.cc:25:19: error: expected '}' at end of input
25 | return 0;
| ^
a.cc:3:1: note: to match this '{'
3 | {
| ^
|
s824416535 | p03844 | Java | import java.util.Scanner;
public class AddSubtract {
public static void main(String[] args) {
// scanner to read
final Scanner scan = new Scanner(System.in);
// variables
int A = scan.nextInt();
int B = scan.nextInt();
String op = scan.next();
//the works baby
if (op.equals("-")){
System.out.p... | Main.java:3: error: class AddSubtract is public, should be declared in a file named AddSubtract.java
public class AddSubtract {
^
1 error
|
s701918094 | p03844 | C++ | #include<cstdio>
int main()
{
int a,c;
char b,n,m;
int sum;
while(scanf("%d",&a)!=EOF)
{
scanf("%c",&m);
scanf("%c",&b);
scanf("%c",&n);
scanf("%d",&c);
if(b==43)
{
sum=a+c;
printf("%d\n",sum);
}
else
{
sum=a-c;
printf("%d\n",sum);
}
}
return 0; | a.cc: In function 'int main()':
a.cc:25:19: error: expected '}' at end of input
25 | return 0;
| ^
a.cc:3:1: note: to match this '{'
3 | {
| ^
|
s314383002 | p03844 | Java | import java.io.*;
import java.util.Scanner;
public class AddSubtract {
public static void main(String[] args) {
// scanner to read
final Scanner scan = new Scanner(System.in);
// variables
int A = scan.nextInt();
int B = scan.nextInt();
String op = scan.next();
//the works baby
if (op.equals("-")... | Main.java:4: error: class AddSubtract is public, should be declared in a file named AddSubtract.java
public class AddSubtract {
^
1 error
|
s842774716 | p03844 | Java | public class Main {
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
int A;
int B;
String op;
int output = 0;
String input = sc.nextLine();
A = Integer.parseInt(input.substring(0, 1));
op = input.substring(1, 2);
B = Integer.parseInt(input.substring(2, 3));
if(... | Main.java:4: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:4: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
2 errors
|
s521316207 | p03844 | Java | public class Main {
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
int A;
int B;
String op;
int output = 0;
String input = sc.nextLine();
A = Integer.parseInt(input.substring(0, 1));
op = input.substring(1, 2);
B = Integer.parseInt(input.substring(2, 3));
if(... | Main.java:26: error: reached end of file while parsing
}
^
1 error
|
s425219614 | p03844 | Java | import java.util.Scanner;
public class AddSubtract {
public static void main(String[] args) {
// scanner to read
final Scanner scan = new Scanner(System.in);
// variables
int A = scan.nextInt();
int B = scan.nextInt();
String op = scan.next();
//the works baby
if (op.equals("-")){
System.out.p... | Main.java:3: error: class AddSubtract is public, should be declared in a file named AddSubtract.java
public class AddSubtract {
^
1 error
|
s574303602 | p03844 | Java |
import java.util.Scanner;
public class ADD
{
public static void main(String[] args)
{
int A;
int B;
int C;
Scanner N = new Scanner(System.in);
A = N.nextInt();
B = N.nextInt();
C = A+B;
System.out.println( C);
{
}
}
}
| Main.java:4: error: class ADD is public, should be declared in a file named ADD.java
public class ADD
^
1 error
|
s464870840 | p03844 | Java | import java.util.Scanner;
public class blah {
public static void main() {
Scanner input = new Scanner(System.in);
String thing = input.nextLine();
String [] thingies = thing.split(" ");
int datThing = 0;
if (thingies[1].equals("+")) {
datThing = Integer.parseInt... | Main.java:3: error: class blah is public, should be declared in a file named blah.java
public class blah {
^
1 error
|
s143445046 | p03844 | Java | import java.io.; import java.util.;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
str = sc.nextString();
int b = sc.nextInt();
if(str == "+") {
System.out.println(a + b);
} else{
System.out.prinln(a - b);
}
}
} | Main.java:1: error: <identifier> expected
import java.io.; import java.util.;
^
Main.java:1: error: <identifier> expected
import java.io.; import java.util.;
^
2 errors
|
s348489080 | p03844 | C++ | #include <stdio.h>
#include <stdlib.h>
int main()
{
int a,b;
char z;
char c;
char x;
scanf("%d",&a);
c = getchar();
z = getchar();
x = getchar();
scanf("%d", &b);
int e, f;
if (c==43)
{
e = a + b;
printf("%d\n", e);
}
if (c==45)
{
f = a - b;
printf("%d\n", f);
}
system("pause");
| a.cc: In function 'int main()':
a.cc:25:25: error: expected '}' at end of input
25 | system("pause");
| ^
a.cc:4:1: note: to match this '{'
4 | {
| ^
|
s913105787 | p03844 | C++ | #include <stdio.h>
#include <stdlib.h>
int main()
{
int a,b;
char z;
char c;
char x;
scanf("%d",&a);
c = getchar();
z = getchar();
x = getchar();
scanf("%d", &b);
int e, f;
if (c==-)
{
e = a + b;
printf("%d\n", e);
}
if (c==+)
{
f = a - b;
printf("%d\n", f);
}
system("pause"); | a.cc: In function 'int main()':
a.cc:15:17: error: expected primary-expression before ')' token
15 | if (c==-)
| ^
a.cc:20:17: error: expected primary-expression before ')' token
20 | if (c==+)
| ^
a.cc:25:25: error: expected '}' at end of input
25 | ... |
s200133162 | p03844 | Java | import java.io.*;
import java.util.*;
public class main
{
public static void main(String[] args)
{
Scanner scan = new Scanner(System.in);
int first = scan.nextInt();
String op = scan.next();
int second = scan.nextInt();
if(op.equals("+")) {
System.out.println(first + second);
} else {
Syst... | Main.java:4: error: class main is public, should be declared in a file named main.java
public class main
^
1 error
|
s194248992 | p03844 | Java | import java.io.*;
import java.util.*;
public class test
{
public static void main(String[] args)
{
Scanner scan = new Scanner(System.in);
int first = scan.nextInt();
String op = scan.next();
int second = scan.nextInt();
if(op.equals("+")) {
System.out.println(first + second);
} else {
Syst... | Main.java:4: error: class test is public, should be declared in a file named test.java
public class test
^
1 error
|
s328964243 | p03844 | Java |
Scanner s = new Scanner(System.in);
int a = s.nextInt();
String op = s.next();
int b = s.nextInt();
if(op.equals("+")){
System.out.println(a + b);
}
else if(op.equals("-")){
System.out.println(a - b);
}
return;
| Main.java:5: error: unnamed classes are a preview feature and are disabled by default.
Scanner s = new Scanner(System.in);
^
(use --enable-preview to enable unnamed classes)
Main.java:9: error: class, interface, enum, or record expected
if(op.equals("+")){
^
Main.java:11: error: class, interfa... |
s705376229 | p03844 | Java | import java.util.Scanner;
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int a = s.nextInt();
String op = s.next();
int b = s.nextInt();
if(op.equals("+")){
System.out.println(a + b);
}
else if(op.equals("-")){
System.out.println... | Main.java:4: error: unnamed classes are a preview feature and are disabled by default.
public static void main(String[] args) {
^
(use --enable-preview to enable unnamed classes)
1 error
|
s522251387 | p03844 | Java | import java.util.Scanner;
public class OpQuestion {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int a = s.nextInt();
String op = s.next();
int b = s.nextInt();
if(op.equals("+")){
System.out.println(a + b);
}
else if(op.equals("-")){
... | Main.java:3: error: class OpQuestion is public, should be declared in a file named OpQuestion.java
public class OpQuestion {
^
1 error
|
s413338089 | p03844 | Java | int main(int argc, char *argv[]){
Scanner s = new Scanner(System.in);
int a = s.nextInt();
String op = s.next();
int b = s.nextInt();
if(op.equals("+"){
System.out.println(a + b);
}
else if(op.equals("-"){
System.out.println(a - b);
else {
}
return;
}
| An exception has occurred in the compiler (21.0.9). Please file a bug against the Java compiler via the Java bug reporting page (https://bugreport.java.com) after checking the Bug Database (https://bugs.java.com) for duplicates. Include your program, the following diagnostic, and the parameters passed to the Java compi... |
s840276373 | p03844 | Java | import java.util.*;
public class OP{
public static void main(String args[]) {
Scanner sc=new Scanner(System.in);
int A=sc.nextInt();
String OP=sc.next();
int B=sc.nextInt();
int K=0;
switch(OP) {
case "+":
K=A+B;
System.out.println(K);
break;
case "-":
K=... | Main.java:2: error: class OP is public, should be declared in a file named OP.java
public class OP{
^
1 error
|
s813677583 | p03844 | C++ | # include <stdio.h>
#include <stdlib.h>
int main()
{
int a,b;
char c;
scanf_s("%d",&a);
c = getchar();
scanf_s("%d", &b);
int e, f;
if (c==43)
{
e = a + b;
printf("%d\n", e);
}
if (c==45)
{
f = a - b;
printf("%d\n", f);
}
system("pause");
}
| a.cc: In function 'int main()':
a.cc:7:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
7 | scanf_s("%d",&a);
| ^~~~~~~
| scanf
|
s792057384 | p03844 | C | #include <stdio.h>
int main() {
int A op B;
if (op==-) {
printf ("%d\n",A-B); }
else if (op==+) {
printf ("%d\n",A+B);
}
return 0;
}
| main.c: In function 'main':
main.c:4:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'op'
4 | int A op B;
| ^~
main.c:4:15: error: unknown type name 'op'
main.c:5:13: error: 'op' undeclared (first use in this function)
5 | if (op==-) {
| ... |
s876982925 | p03844 | C | #include<stdio.h>
#include<math.h>
int main(){
long n;
scanf(“%ld”,&n);
long a[n];
int ans=1;
for(long i=0;i<n;i++){
scanf(“%ld”,&a[i]);
}
int chek=0;
for(long i=0;i<(n/2)+n%2;i++){
chek=0;
if(n%2==1){
for(long j=0;j<n;j++){
if(i==0){
if(i==a[j... | main.c: In function 'main':
main.c:5:9: error: stray '\342' in program
5 | scanf(<U+201C>%ld<U+201D>,&n);
| ^~~~~~~~
main.c:5:10: error: expected expression before '%' token
5 | scanf(“%ld”,&n);
| ^
main.c:5:13: error: stray '\342' in program
5 | scanf(<U+201C>%ld<U+201D>,... |
s711448614 | p03844 | C++ | #include<iostream>
using namespace std;
int main() {
int a,op,b;
cin >> a >> op >> b;
if (op == "+") {
cout << a + b << endl;
} else {
cout << a - b << endl;
}
}
| a.cc: In function 'int main()':
a.cc:7:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
7 | if (op == "+") {
| ~~~^~~~~~
|
s293091779 | p03844 | C++ | #include<iostream>
using namespace std;
int main() {
int a,op,b;
cin >> a >> op >> b;
if (op == "+") {
cout << a + b << endl;
} else if (op == "-") {
cout << a - b << endl;
}
}
| a.cc: In function 'int main()':
a.cc:7:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
7 | if (op == "+") {
| ~~~^~~~~~
a.cc:9:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
9 | } else if (op == "-") {
| ~~~^~~... |
s151802469 | p03844 | C++ | #include<iostream>
using namespace std;
int main() {
int a,op,b;
cin >> a >> op >> b;
if (op == +) {
cout << a + b << endl;
} else if (op == -) {
cout << a - b << endl;
}
} | a.cc: In function 'int main()':
a.cc:7:14: error: expected primary-expression before ')' token
7 | if (op == +) {
| ^
a.cc:9:21: error: expected primary-expression before ')' token
9 | } else if (op == -) {
| ^
|
s551974890 | p03844 | C | #include <stdio.h>
int main(void){
//
int a, b;
char c;
//
scanf("%d %c %d",a,c,b);
//
if(c == '+')
printf("%d\n",a+b);
else
printf("%d\n",a-b)
return 0;
} | main.c: In function 'main':
main.c:12:27: error: expected ';' before 'return'
12 | printf("%d\n",a-b)
| ^
| ;
13 | return 0;
| ~~~~~~
|
s774986548 | p03844 | C | #include<studio.h>
using namespace std;
map<int,int>q;
long long h,m;
char s;
int main()
{
scanf("%lld %c %lld",&h,&s,&m);
if(s=='+')
{
printf("%lld\n",h+m);
}
else
{
printf("%lld\n",h-m);
}
return 0;
} | main.c:1:9: fatal error: studio.h: No such file or directory
1 | #include<studio.h>
| ^~~~~~~~~~
compilation terminated.
|
s546298973 | p03844 | Java | import java.util.Scanner;
public class main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int int1 = sc.nextInt();
String str = sc.next();
int int2 = sc.nextInt();
if(str.equals("+")){
System.out.println(int1 + int2);
}else{
System.out.println(int1 - int2);
}
}... | Main.java:3: error: class main is public, should be declared in a file named main.java
public class main {
^
1 error
|
s149491077 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string op;
int A,B;
cin >> A >> op >> B;
if(op ==“+”){
cout << A+B<< endl;
}else{
cout<< A-B << endl;
} | a.cc:8:11: error: extended character “ is not valid in an identifier
8 | if(op ==“+”){
| ^
a.cc:8:13: error: extended character ” is not valid in an identifier
8 | if(op ==“+”){
| ^
a.cc: In function 'int main()':
a.cc:8:11: error: '\U0000201c' was not declared in this scop... |
s061361927 | p03844 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int a,b;
char str;
cin >> a >> str >> b;
if(str=="+"){
cout << a+b << endl;
}
else{
cout << a-b << endl;
}
}
| a.cc: In function 'int main()':
a.cc:9:9: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
9 | if(str=="+"){
| ~~~^~~~~
|
s839613935 | p03844 | C | #include "pch.h"
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main(void)
{
//整数//
int a, b;
//結果//
int result;
//演算子//
char op;
//入力//
scanf_s("%d", &a);
scanf_s(" %c", &op);
scanf_s("%d", &b);
//出力//
if (op == '+') {
result = a + b;
printf("%d", result);
}
... | main.c:1:10: fatal error: pch.h: No such file or directory
1 | #include "pch.h"
| ^~~~~~~
compilation terminated.
|
s404780236 | p03844 | C++ | #include "pch.h"
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main(void)
{
//整数//
int a, b;
//結果//
int result;
//演算子//
char op;
//入力//
scanf_s("%d", &a);
scanf_s(" %c", &op);
scanf_s("%d", &b);
//出力//
if (op == '+') {
result = a + b;
printf("%d", result);
}
... | a.cc:1:10: fatal error: pch.h: No such file or directory
1 | #include "pch.h"
| ^~~~~~~
compilation terminated.
|
s090539545 | p03844 | C++ | include <iostream>
int main() {
int A, B;
char op;
std::cin >> A >> op >> B;
int eval = 0;
if ( op == '+' ) {
eval = A + B;
} else if ( op == '-' ) {
eval = A - B;
}
std::cout << eval << std::endl;
return 0;
}
| a.cc:1:1: error: 'include' does not name a type
1 | include <iostream>
| ^~~~~~~
|
s757959253 | p03844 | Java | import java.util.*;
class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int A = sc.nextInt();
String op = sc.next();
int B = sc.nextInt();
int ans;
if(op.chatAt(0)=='+') ans = A+B;
else ans = A-B;
System.out.printl... | Main.java:10: error: cannot find symbol
if(op.chatAt(0)=='+') ans = A+B;
^
symbol: method chatAt(int)
location: variable op of type String
1 error
|
s810165491 | p03844 | C++ | using System;
public class Hey{
public static void Main(){
var line = Console.ReadLine().Split(' ');
if(line[1] == '+') Console.WriteLine(line[0]+line[2]);
else Console.WriteLine(line[0]-line[2]);
}
} | a.cc:1:7: error: expected nested-name-specifier before 'System'
1 | using System;
| ^~~~~~
a.cc:3:1: error: expected unqualified-id before 'public'
3 | public class Hey{
| ^~~~~~
|
s963104484 | p03844 | C++ | ghoge | a.cc:1:1: error: 'ghoge' does not name a type
1 | ghoge
| ^~~~~
|
s951197100 | p03844 | C++ | #include <string.h>
#include <iostream>
using namespace std;
int num1, num2;
char s[1];
cin >> num1 >> s >> num2;
if (strcmp(s, "+")==0) {
cout << num1 + num2 << endl;
}
if (strcmp(s, "-") == 0) {
cout << num1 - num2 << endl;
} | a.cc:6:9: error: 'cin' does not name a type
6 | cin >> num1 >> s >> num2;
| ^~~
a.cc:7:9: error: expected unqualified-id before 'if'
7 | if (strcmp(s, "+")==0) {
| ^~
a.cc:10:9: error: expected unqualified-id before 'if'
10 | if (strcmp(s, "-") == 0) {
... |
s097112093 | p03844 | C++ | int num1, num2;
char s[1];
cin >> num1 >> s >> num2;
if (strcmp(s, "+")==0) {
cout << num1 + num2 << endl;
}
if (strcmp(s, "-") == 0) {
cout << num1 - num2 << endl;
} | a.cc:3:9: error: 'cin' does not name a type
3 | cin >> num1 >> s >> num2;
| ^~~
a.cc:4:9: error: expected unqualified-id before 'if'
4 | if (strcmp(s, "+")==0) {
| ^~
a.cc:7:9: error: expected unqualified-id before 'if'
7 | if (strcmp(s, "-") == 0) {
... |
s419300836 | p03844 | C++ | #include <iostream>
using namespace std;
int main() {
int num1, num2;
char s[1];
//scanf("%d %s %d", &num1, s, &num2);
cin >> num1 >> s >> num2;
if (strcmp(s, "+")==0) {
cout << num1 + num2 << endl;
}
else {
cout << num1 - num2 << endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:8:13: error: 'strcmp' was not declared in this scope
8 | if (strcmp(s, "+")==0) {
| ^~~~~~
a.cc:2:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include <iostream>
+++ |+#include <c... |
s566378994 | p03844 | C++ | #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>
void main() {
int num1, num2;
char s[1];
scanf("%d %s %d", &num1, s, &num2);
if (strcmp(s, "+")==0) {
printf("%d", num1 + num2);
}
else {
printf("%d", num1 - num2);
}
} | a.cc:4:1: error: '::main' must return 'int'
4 | void main() {
| ^~~~
|
s088021895 | p03844 | C++ | #include <iostream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <cmath>
#include <climits>
#define F first
#define S second
#define vsort(v) sort((v).begin(), (v).end())
#define vrev(v) reverse((v).begin(), (v).end())
//INT_MAX
//INT_MIN
//LLONG_MAX
//LLONG_MIN
//DBL_MIN
//DBL_MA... | a.cc: In function 'int main(int, const char**)':
a.cc:28:12: error: expected initializer before ':' token
28 | ll a, b:
| ^
a.cc:30:17: error: 'op' was not declared in this scope
30 | cin >> a >> op >> b;
| ^~
a.cc:30:23: error: 'b' was not declared in this scope
... |
s240659346 | p03844 | C++ | #include<iostream>
using namespace std;
int main(){
int a, b;
string op;
cin >> a >> op >> b;
switch(op){
case '+':
cout << a+b << endl;
break;
case '-':
cout << a-b << endl;
break;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:8:10: error: switch quantity not an integer
8 | switch(op){
| ^~
|
s252057929 | p03844 | C++ | #include<iostream>
using namespace std:
int main(){
int a, b;
string op;
cin >> a >> op >> b;
switch(op){
case '+':
cout << a+b << endl;
break;
case '-':
cout << a-b << endl;
break;
}
return 0;
} | a.cc:2:20: error: expected ';' before ':' token
2 | using namespace std:
| ^
| ;
a.cc:2:20: error: expected unqualified-id before ':' token
|
s251482516 | p03844 | C++ | #include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);i++)
const int MOD=(int)1e9+7;
using namespace std;
int main(){
int a,b;
string op;
cin >> a >> op >> b;
if(op == '+') cout << a + b << endl;
else cout << a - b << endl;
} | a.cc: In function 'int main()':
a.cc:9:11: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
9 | if(op == '+') cout << a + b << endl;
| ~~ ^~ ~~~
| | |
| | char
| std::string {aka std... |
s075330888 | p03844 | C++ | #include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);i++)
const int MOD=(int)1e9+7;
using namespace std;
int main(){
int a,b;
string op;
cin >> a >> b >> op;
if(op == '+') cout << a + b << endl;
else cout << a - b << endl;
} | a.cc: In function 'int main()':
a.cc:9:11: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
9 | if(op == '+') cout << a + b << endl;
| ~~ ^~ ~~~
| | |
| | char
| std::string {aka std... |
s967090379 | p03844 | C++ | #include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);i++)
const int MOD=(int)1e9+7;
using namespace std;
int main(){
int a,b,op;
cin >> a >> b >> op;
if(op == '+') cout << a += b << endl;
else cout << a -= b << endl;
} | a.cc: In function 'int main()':
a.cc:8:34: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
8 | if(op == '+') cout << a += b << endl;
| ~~^~~~~~~
a.cc:9:25: error: invalid operands of types 'int' and '<unresolved overl... |
s943263198 | p03844 | C++ | #include<iostream>
using namespace std;
int main()
{while(1)
{cout<<“AC”<<endl;
}
return 0;}
| a.cc:5:9: error: extended character “ is not valid in an identifier
5 | {cout<<“AC”<<endl;
| ^
a.cc:5:9: error: extended character ” is not valid in an identifier
a.cc: In function 'int main()':
a.cc:5:9: error: '\U0000201cAC\U0000201d' was not declared in this scope
5 | {cout<<“AC”<<endl;
... |
s041939111 | p03844 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
int a,b;
char c;
cin>>a>>c>>b;
if(c=='+'){
cout<<a+b<<endl;
}
else{
cout<<a-b<<endl;
}
return 0;!
} | a.cc: In function 'int main()':
a.cc:14:14: error: '\U0000ff01' was not declared in this scope
14 | return 0;!
| ^~
|
s676829168 | p03844 | C++ | #include <iostream>
#include <string>
using namespace std;
int main(){
int a,c;
char b;
cin>>a>>b>>c;
if(b==+){cout<<a+c<<endl;}
else{cout<<a-c<<endl;}
return 0;
}
| a.cc: In function 'int main()':
a.cc:8:10: error: expected primary-expression before ')' token
8 | if(b==+){cout<<a+c<<endl;}
| ^
|
s645156051 | p03844 | C++ | #include<iostream>
using namespace std;
int main(void){
char c;
int a,b;
cin>>a>>c>>b;
if(c=="+"){
cout<<a+b<<endl;
}
else{
cout<<a-b<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:7:7: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
7 | if(c=="+"){
| ~^~~~~
|
s020333958 | p03844 | C++ | #include <iostream>
#include <cstdlib>
#include <cstring>
int main()
{
int m, n;
string op;
std::cin >> m >> op >> n;
if ( !strcmp(op, "+") ) std::cout << (m + n) << std::endl;
if ( !strcmp(op, "-") ) std::cout << (m - n) << std::endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:8:5: error: 'string' was not declared in this scope
8 | string op;
| ^~~~~~
a.cc:8:5: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
from /usr/include/c++/14/ios:40,
from /usr/include/c++/14/ostr... |
s645730131 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int a, c;
string b;
int main(){
cin<<a<<b<<c;
if(b == "+"){
cout<<a+c<<endl;
}else{
cout<<a-c<<endl;
}
} | a.cc: In function 'int main()':
a.cc:7:6: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int')
7 | cin<<a<<b<<c;
| ~~~^~~
| | |
| | int
| std::istream {aka std::basic_istream<char>}
a.cc:7:6: note: candidate: 'operator... |
s608470872 | p03844 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
int a,b;
char c;
cin>>a>>c>>b;
if(c=='+')
cout<<a+b<<endl;
else
cout<<a-b<<endl;
return 0;!
} | a.cc: In function 'int main()':
a.cc:12:14: error: '\U0000ff01' was not declared in this scope
12 | return 0;!
| ^~
|
s792903952 | p03844 | C++ | #include <bits/stdc++.h>
#include <ctype.h>
using namespace std;
int main(void){
int a, p;
char op;
cin >> a >> op >> p;
cout << (op=='+'?a+b:a-b) << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:11:22: error: 'b' was not declared in this scope
11 | cout << (op=='+'?a+b:a-b) << endl;
| ^
|
s161903578 | p03844 | C++ | #include <bits/stdc++.h>
#include <ctype.h>
using namespace std;
int main(void){
int a, p;
char op;
cin >> a >> op >> p;
cout << (OP=='+'?a+b:a-b) << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:11:12: error: 'OP' was not declared in this scope; did you mean 'op'?
11 | cout << (OP=='+'?a+b:a-b) << endl;
| ^~
| op
a.cc:11:22: error: 'b' was not declared in this scope
11 | cout << (OP=='+'?a+b:a-b) << endl;
| ... |
s119895850 | p03844 | C++ | #include<stdio.h>
#define INF 1000000000
int main(void){
int A,B;
int res;
char op;
printf("enter two numbers and an operand\n");
printf("A = ");
scanf("%d",&A);
while(0<=A && A <= INF){
printf("out of range\n");
scanf("%d",&A);
}
printf("op is");
op = getchar();
while(op == '+' || op =... | a.cc: In function 'int main()':
a.cc:20:5: error: 'print' was not declared in this scope; did you mean 'printf'?
20 | print("Unkown error!\n");
| ^~~~~
| printf
|
s593087694 | p03844 | C++ | #include<stdio.h>
#define INF 1000000000
int main(void){
int A,B;
int res;
char op;
printf("enter two numbers and an operand\n");
printf("A = ");
scanf("%d",&A);
while(0<=A && A <= INF){
printf("out of range\n");
scanf("%d",&A);
}
printf("op is");
scanf("%c",op);
while(op == '+' || op =... | a.cc: In function 'int main()':
a.cc:20:5: error: 'print' was not declared in this scope; did you mean 'printf'?
20 | print("Unkown error!\n");
| ^~~~~
| printf
a.cc:26:5: error: 'pritnf' was not declared in this scope; did you mean 'printf'?
26 | pritnf("out of range\n");
| ... |
s632389307 | p03844 | C++ | #include <iostream>
#include <cstdlib>
int a,b,ans;
char c;
int main()
{
cin>>a>>c>>b;
if(c=='+') ans=a+b;
else ans=a-b;
cout<<ans<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:7:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
7 | cin>>a>>c>>b;
| ^~~
| std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Lin... |
s631461866 | p03844 | C++ | #include <iostream>
int a,b,ans;
char c;
int main()
{
cin>>a>>c>>b;
if(f=='+') ans=a+b;
else ans=a-b;
cout<<ans<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
6 | cin>>a>>c>>b;
| ^~~
| std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Lin... |
s906928235 | p03844 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
int a,b;
char h;
cin>>a>>h>>b;
if(h=='+')
cout<<a+b<<endl;
else
cout<<a-b<<endl;
return 0;!
| a.cc: In function 'int main()':
a.cc:12:14: error: '\U0000ff01' was not declared in this scope
12 | return 0;!
| ^~
a.cc:12:16: error: expected '}' at end of input
12 | return 0;!
| ^
a.cc:4:1: note: to match this '{'
4 | {
| ^
|
s908980638 | p03844 | C | #include <stdio.h>
int main(void) {
int a;
char e;
int b;
scanf("%d",&a);
scanf("%c",&e);
scanf("%d",&b);
if(e=='+'){
printf("%d",a+b);}
if(e=='-'{
printf("%d",a-b);}
return 0;
} | main.c: In function 'main':
main.c:12:11: error: expected ')' before '{' token
12 | if(e=='-'{
| ~ ^
| )
main.c:15:1: error: expected expression before '}' token
15 | }
| ^
|
s969827060 | p03844 | C++ | #include <string>
#include <sstream>
#include <iostream>
int main(){
int a, b;
string op;
cin >> a >> op >> b;
if (op == "+"){
cout << a + b << endl;
}else{
cout << a-b <<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:7:3: error: 'string' was not declared in this scope
7 | string op;
| ^~~~~~
a.cc:7:3: note: suggested alternatives:
In file included from /usr/include/c++/14/string:41,
from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note: 'std::string'
7... |
s542577959 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
string op;
int A, B;
cin A >> op >> B;
if(op=="+"){
cout << A+B << endl;
}
else{cout << A-B << endl;}
} | a.cc: In function 'int main()':
a.cc:7:6: error: expected ';' before 'A'
7 | cin A >> op >> B;
| ^~
| ;
|
s227420457 | p03844 | C++ | #include<iostream>
using namespace std;
int main(){
int N;
cin>>N;
int pp[N];
for(int i=0;i<N;i++)cin>>PP[i];
int M;
int o[M];
for(int y=0;y<M;y++)cin>>o[y];
for(y=0;y<N;y++){
int x;
cin>>x;
pp[y]=x;
for(int g=0;g<N;g++){
int z;
z=z+pp[g];
cout<<z<<endl;
}
return 0;
}
} | a.cc: In function 'int main()':
a.cc:8:26: error: 'PP' was not declared in this scope; did you mean 'pp'?
8 | for(int i=0;i<N;i++)cin>>PP[i];
| ^~
| pp
a.cc:12:5: error: 'y' was not declared in this scope
12 | for(y=0;y<N;y++){
| ^
|
s754961590 | p03844 | C++ | #include<iostream>
using namespace std;
int main(){
int N;
cin>>N;
int pp[N];
for(int i=0;i<N;i++)cin>>PP[i];
int M;
int o[M];
for(int y=0;y<M;y++)cin>>o[y];
for(y=0;y<N;y++){
int x;
cin>>x;
pp[y]=x;
for(int g=0;g<N;g++){
int z;
z=z+pp[g];
cout<<z<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:8:26: error: 'PP' was not declared in this scope; did you mean 'pp'?
8 | for(int i=0;i<N;i++)cin>>PP[i];
| ^~
| pp
a.cc:12:5: error: 'y' was not declared in this scope
12 | for(y=0;y<N;y++){
| ^
a.cc:22:2... |
s091614031 | p03844 | C++ | #include<iostream>
using namespace std;
int main(){
int N;
cin>>N;
int pp[N];
for(int i=0;i<N;i++)cin>>PP[i];
int M;
int o[M];
for(int y=0;y<M;y++)cin>>o[y];
int rr[N];
for(y=0;y<N;y++)cin>>rr[y];
int x;
cin>>x;
rr[p]=x;
for(int g=0;g<N;g++){
int z;
z=z+pp[g];
cout<<z<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:8:26: error: 'PP' was not declared in this scope; did you mean 'pp'?
8 | for(int i=0;i<N;i++)cin>>PP[i];
| ^~
| pp
a.cc:13:5: error: 'y' was not declared in this scope
13 | for(y=0;y<N;y++)cin>>rr[y];
| ^... |
s885512048 | p03844 | C++ | #include<iostream>
using namespace std;
int main(){
int N;
cin>>N;
int pp[N];
for(int i=0;i<N;i++)cin>>PP[i];
int M;
int o[M];
for(int y=0;y<M;y++)cin>>o[y];
int rr[N];
for(int p=0;p<N;p++)cin>>rr[p];
for(p=0;p<M;p++){
int x;
cin>>x;
rr[p]=x;
for(int g=0;g<N;g++){
int z;
z=z+pp[g];
cout<<z<<endl;
}
}
return... | a.cc: In function 'int main()':
a.cc:8:26: error: 'PP' was not declared in this scope; did you mean 'pp'?
8 | for(int i=0;i<N;i++)cin>>PP[i];
| ^~
| pp
a.cc:14:5: error: 'p' was not declared in this scope
14 | for(p=0;p<M;p++){
| ^
|
s290174253 | p03844 | C++ | #include<iostream>
using namespace std;
int main(){
int N;
cin>>N;
int pp[N];
for(int i=0;i<N;i++)cin>>PP[i];
int M;
int o[M];
for(int y=0;y<M;y++)cin>>o[y];
int rr[N];
for(int p=0;p<N;p++)cin>>rr[p];
y=p;
int x;
cin>>x;
rr[p]=x;
rr[N]=PP[N];
for(int g=0;g<N;g++){
int z;
z=z+pp[g];
cout<<z<<endl;
}
return ... | a.cc: In function 'int main()':
a.cc:8:26: error: 'PP' was not declared in this scope; did you mean 'pp'?
8 | for(int i=0;i<N;i++)cin>>PP[i];
| ^~
| pp
a.cc:14:1: error: 'y' was not declared in this scope
14 | y=p;
| ^
a.cc:14:3: error: 'p' was ... |
s115895387 | p03844 | C++ | #include<iostream>
using namespace std;
int main(){
int N;
cin>>N;
int pp[N];
for(int i=0;i<N;i++)cin>>PP[i];
int M;
int o[M];
for(int y=0;y<M;y++)cin>>o[y];
for(int p=0;p<N;p++)cin>>pp[p];
y=p;
int x;
cin>>x;
pp[p]=x;
for(int g=0;g<N;g++){
int z;
z=z+pp[g];
cout<<z<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:8:26: error: 'PP' was not declared in this scope; did you mean 'pp'?
8 | for(int i=0;i<N;i++)cin>>PP[i];
| ^~
| pp
a.cc:13:1: error: 'y' was not declared in this scope
13 | y=p;
| ^
a.cc:13:3: error: 'p' was ... |
s712803519 | p03844 | C++ | #include<iostream>
using namespace std;
int main(){
int N;
cin>>N;
int
for(int i=0;i<N;i++)cin>>PP[i];
int M;
for(int y=0;y<M;y++)cin>>o[y];
for(int p=0;p<N;p++)cin>>pp[p];
y=p;
int x;
cin>>x;
pp[p]=x;
for(int g=0;g<N;g++){
int z;
z=z+pp[g];
cout<<z<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:8:1: error: expected unqualified-id before 'for'
8 | for(int i=0;i<N;i++)cin>>PP[i];
| ^~~
a.cc:8:13: error: 'i' was not declared in this scope
8 | for(int i=0;i<N;i++)cin>>PP[i];
| ^
a.cc:10:26: error: 'o' was not declared in this scope
10 | for(i... |
s106116671 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int A, B;
char op;
cin >> A >> op >> B;
if (op == '+'){
A+=B;
cout << A << endl;
}
else {
A-=B;
cout << A << endl;
} | a.cc: In function 'int main()':
a.cc:17:2: error: expected '}' at end of input
17 | }
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s353086273 | p03844 | Java | import java.util.Scanner;
class Main{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int op = sc.next();
int b = sc.nextInt();
if(op=="+"){
System.out.println(a+b);
}else{
System.out.println(a-b);
}
}
} | Main.java:6: error: incompatible types: String cannot be converted to int
int op = sc.next();
^
Main.java:8: error: bad operand types for binary operator '=='
if(op=="+"){
^
first type: int
second type: String
2 errors
|
s631002629 | p03844 | Java | import java.util.Scanner;
public Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int A = sc.nextInt();
String OP = sc.next();
int B = sc.nextInt();
if (OP.endsWith("+")) System.out.println(A+B);
else System.out.println(A-B);
}
}
| Main.java:2: error: class, interface, enum, or record expected
public Main {
^
Main.java:3: error: unnamed classes are a preview feature and are disabled by default.
public static void main(String[] args) {
^
(use --enable-preview to enable unnamed classes)
Main.java:11: error: class, interface... |
s289728261 | p03844 | Java | import java.util.Scanner;
class example(){
public static void main(){
}
} | Main.java:3: error: '{' expected
class example(){
^
1 error
|
s162149482 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string c;
cin >> c;
if(c == "a" || c== "i" || c== "u" || c== "e" || c== "o"){
cout << "vowel" << endl;
}
else{
cout << "consonant" << endl;
}
}
#include <bits/stdc++.h>
using namespace std;
int main() {
int a,b;
string op;
if(op=="+"||op=="... | a.cc:22:5: error: redefinition of 'int main()'
22 | int main() {
| ^~~~
a.cc:4:5: note: 'int main()' previously defined here
4 | int main() {
| ^~~~
|
s082500691 | p03844 | C++ | #include<iostream>
#include<algorithm>
#include<math.h>
#include<set>
#include<vector>
#include<map>
using namespace std;
int a;
char x;
int b;
cin>>a>>x>>b;
if(x=='+')
cout<<a+b<<endl;
else
cout<<a-b<<endl;
} | a.cc:11:1: error: 'cin' does not name a type
11 | cin>>a>>x>>b;
| ^~~
a.cc:12:1: error: expected unqualified-id before 'if'
12 | if(x=='+')
| ^~
a.cc:14:1: error: expected unqualified-id before 'else'
14 | else
| ^~~~
a.cc:16:1: error: expected declaration before '}' token
16 | }
| ^... |
s373596408 | p03844 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
long a,b;
char op;
cin>>a>>op>>b;
if(op=='+'){
cout<<a+b<<endl;
}
if(op=='-'){
cour<<a-b<<endl;
}
} | a.cc: In function 'int main()':
a.cc:11:5: error: 'cour' was not declared in this scope
11 | cour<<a-b<<endl;
| ^~~~
|
s783805835 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
long long a, b;
char n;
int >> a >> n >> b;
if(n == '+'){
cout << a + b << endl;
return 0;
}
cout << a - b << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:7:13: error: expected unqualified-id before '>>' token
7 | int >> a >> n >> b;
| ^~
|
s136054656 | p03844 | C++ | #include<bits/stdc++.h>
using namespace std;
int main{
int a,b;
char op;
cin>>a>>op>>b;
if(op=='+')cout<<a+b<<endl;
else cout<<a-b<<endl;
return 0;
} | a.cc:3:5: error: cannot declare '::main' to be a global variable
3 | int main{
| ^~~~
a.cc:4:3: error: expected primary-expression before 'int'
4 | int a,b;
| ^~~
a.cc:4:3: error: expected '}' before 'int'
a.cc:3:9: note: to match this '{'
3 | int main{
| ^
a.cc:6:3: error:... |
s480704508 | p03844 | C++ | #include <bits/stdc++>
using namespace std;
int main(void) {
int a, b;
char op;
cin >> a >> op >> b;
if(op == '+') cout << a+b <<endl;
else if(op =='-') cout << a-b <<endl;
} | a.cc:1:10: fatal error: bits/stdc++: No such file or directory
1 | #include <bits/stdc++>
| ^~~~~~~~~~~~~
compilation terminated.
|
s322298716 | p03844 | C++ | #include <bits/stdc++>
using namespace std;
int main(void) {
int a, b;
char op;
cin >> a >> op >> b;
if(op == '+') cout << a+b <<endl;
else(op =='-') cout << a-b <<endl;
} | a.cc:1:10: fatal error: bits/stdc++: No such file or directory
1 | #include <bits/stdc++>
| ^~~~~~~~~~~~~
compilation terminated.
|
s453387927 | p03844 | C++ | int a,b;
string op;
cin>> a >> op >> b;
if(op == "+")
cout << a+b << endl;
else
cout << a-b << endl; | a.cc:2:1: error: 'string' does not name a type
2 | string op;
| ^~~~~~
a.cc:4:1: error: 'cin' does not name a type
4 | cin>> a >> op >> b;
| ^~~
a.cc:6:1: error: expected unqualified-id before 'if'
6 | if(op == "+")
| ^~
a.cc:9:1: error: expected unqualified-id before 'else'
9 | else
... |
s805082387 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int A,B;
string op;
cin >> A >> op >> B;
if(op = "+") cout << A + B;
else cout << A - B;
} | a.cc: In function 'int main()':
a.cc:8:9: error: could not convert 'op.std::__cxx11::basic_string<char>::operator=(((const char*)"+"))' from 'std::__cxx11::basic_string<char>' to 'bool'
8 | if(op = "+") cout << A + B;
| ~~~^~~~~
| |
| std::__cxx11::basic_string<char>
|
s902180091 | p03844 | C++ | #include <iostream>
using namespace std;
int main()
{
int a,b;
char op;
cin >> a >> op >> b;
if(op=="+"){
cout << (a + b) << endl;
}else{
cout << (a - b) << endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:9:8: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
9 | if(op=="+"){
| ~~^~~~~
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.