submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s840752178 | p03844 | C++ | #include<iostream>
#include<string>
using namespace std;
int main(void){
int a, c;
string 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:8: error: could not convert 'b.std::__cxx11::basic_string<char>::operator=(((const char*)"+"))' from 'std::__cxx11::basic_string<char>' to 'bool'
8 | if(b = "+") cout << a + c <<endl;
| ~~^~~~~
| |
| std::__cxx11::basic_string<char>
|
s797700197 | 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:7:3: error: expected initializer before 'cin'
7 | cin >> a >> c >> b;
| ^~~
a.cc:8:7: error: 'c' was not declared in this scope
8 | if (c=='+') cout << a+b << endl;
| ^
|
s758936142 | p03844 | C++ | #include <iostream>
using namespace std;
int main() {
int a,b;
char op;
cin >> a >> op >> b;
if(op=='+''){
cout << a+b;
}
if(op=='-'){
cout << a-b;
}
return 0;
} | a.cc:8:19: warning: missing terminating ' character
8 | if(op=='+''){
| ^
a.cc:8:19: error: missing terminating ' character
8 | if(op=='+''){
| ^~~
a.cc: In function 'int main()':
a.cc:8:19: error: expected ';' before 'cout'
8 | if(op==... |
s655168928 | p03844 | C++ | #include <iostream>
using namespace std;
int main() {
int a;
int b;
char op;
cin >> a >> op >> b;
if(op == '+'){
cout << a+b;
}
if(op == '-'){
cout << a-b;
}
| a.cc: In function 'int main()':
a.cc:18:2: error: expected '}' at end of input
18 | }
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s419211800 | p03844 | C++ | #include <iostream>
using namespace std;
int main() {
int a,b;
char op;
cin >> a >> op >> b;
if(op=='+''){
cout << a+b;
}else if(op=='-'){
cout << a-b;
}
return 0;
} | a.cc:8:19: warning: missing terminating ' character
8 | if(op=='+''){
| ^
a.cc:8:19: error: missing terminating ' character
8 | if(op=='+''){
| ^~~
a.cc: In function 'int main()':
a.cc:8:19: error: expected ';' before 'cout'
8 | if(op==... |
s690586391 | p03844 | C++ | #include <iostream>
using namespace std;
int main() {
int a;
int b;
char op;
cin >> a >> op >> b;
if(op == '+'){
cout << a+b;
}
if(op == '-'){
cout << a-b;
}
| a.cc: In function 'int main()':
a.cc:18:2: error: expected '}' at end of input
18 | }
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s123280451 | p03844 | C++ | #include<iostream>
using namespace std;
int main() {
int a;
int b;
char op;
cin >> a >> op >> b
if(op=='+'){
cout << a+b;
}
if(op=='-'){
cout << a-b;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:9:28: error: expected ';' before 'if'
9 | cin >> a >> op >> b
| ^
| ;
10 | if(op=='+'){
| ~~
|
s786392877 | p03844 | C++ | #include <iostream>
using namespace std;
int main(){
int a;
int b;
char op;
cin >> a >> op >> b;
if(op == "+"){
cout << a+b;
}
if(op == "-"){
cout << a-b;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:9:7: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
9 | if(op == "+"){
| ~~~^~~~~~
a.cc:12:7: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
12 | if(op == "-"){
| ~~~^~~~~~
|
s590721099 | p03844 | C++ | #include <iostream>
using namespace std;
int main() {
int a,b;
char op;
cin >> a >> op >> b;
if(op=='+''){
cout<< a+b;
}else if(op=='-'){
cout <<a-b;
}
return 0;
} | a.cc:8:19: warning: missing terminating ' character
8 | if(op=='+''){
| ^
a.cc:8:19: error: missing terminating ' character
8 | if(op=='+''){
| ^~~
a.cc: In function 'int main()':
a.cc:8:19: error: expected ';' before 'cout'
8 | if(op==... |
s812305260 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string 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:12:14: error: no match for 'operator-' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
12 | cout << A-B << endl;
| ~^~
| | |
| | basic_s... |
s142465518 | 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 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::ostream' {aka 'std::basic_ostream<char>'} and 'int')
9 | cout >> a + b >> endl;
| ~~~~ ^~ ~~~~~
| | |
| | int
| std::ostream {aka std::basic_ostream<char>}... |
s845469665 | p03844 | C++ | a, op, b = input().split(" ")
a, b = int(a), int(b)
if op == "-": print(a-b)
elif op == "+": print(a+b) | a.cc:1:1: error: 'a' does not name a type
1 | a, op, b = input().split(" ")
| ^
|
s612219826 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int a,b,y;
string x;
cin >>a>>x>>b;
if(x=='+'){y=a+b;}
else{y=a-b;}
cout<<y<<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=='+'){y=a+b;}
| ~^~~~~
| | |
| | char
| std::string {aka std::__cxx11::basic_string<char>}
In file... |
s542070036 | p03844 | C++ | #include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
long long inf=(long long)1E17;
#define i_7 (long long)(1E9+7)
long mod(long a){
long long c=a%i_7;
if(c>=0)return c;
return c+i_7;
}
using namespace std;
bool prime(int n){
if(n==1){
return false;
}else if(n==2){
return true;
}else... | a.cc: In function 'int main()':
a.cc:90:8: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
90 | if(op=='+'){
| ~~^~~~~
| | |
| | char
| std::string {aka std::__cxx11::basic_string<char>}
In file i... |
s971409911 | p03844 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string a;
int A,B,ans;
cin >> A >> a >> B;
if(a = "+"){
ans = A+B;
}
else{
ans= A-B;
}
cout << ans << endl;
} | a.cc: In function 'int main()':
a.cc:8:8: error: could not convert 'a.std::__cxx11::basic_string<char>::operator=(((const char*)"+"))' from 'std::__cxx11::basic_string<char>' to 'bool'
8 | if(a = "+"){
| ~~^~~~~
| |
| std::__cxx11::basic_string<char>
|
s943812655 | p03844 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string a;
int A,B,ans;
cin >> A >> a >> B;
if(a = '+'){
ans = A+B;
}
else{
ans= A-B;
}
cout << ans << endl;
} | a.cc: In function 'int main()':
a.cc:8:8: error: could not convert 'a.std::__cxx11::basic_string<char>::operator=(43)' from 'std::__cxx11::basic_string<char>' to 'bool'
8 | if(a = '+'){
| ~~^~~~~
| |
| std::__cxx11::basic_string<char>
|
s713582160 | p03844 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string a;
int A,B,ans;
cin >> A >> a >> B;
if(a == '+'){
ans = A+B;
}
else{
ans= A-B;
}
cout << ans << 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(a == '+'){
| ~ ^~ ~~~
| | |
| | char
| std::string {aka std::__cxx11::basic_string<char>}
In fil... |
s253677835 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int x, y;
stirng op;
cin >> x >> op >> y;
if (op == "+") {
cout << x + y << endl;
}
else {
cout << x - y << endl;
}
}
| a.cc: In function 'int main()':
a.cc:6:3: error: 'stirng' was not declared in this scope
6 | stirng op;
| ^~~~~~
a.cc:7:15: error: 'op' was not declared in this scope
7 | cin >> x >> op >> y;
| ^~
|
s601743461 | p03844 | C++ | #include <iostream>
#include <cstdio>
#include <string.h>
#include <stdio.h>
using namespace std;
int main(){
int a;
int b;
int c;
char n1;
char e;
scanf("%d", &a);
scanf("%c", &n1);
scanf("%c", &e);
scanf("%d", &b);
if('+' == e){
c = (a + b);
};
if('-' == e... | a.cc: In function 'int main()':
a.cc:24:23: error: expected '}' at end of input
24 | printf("%d\n", c);
| ^
a.cc:7:11: note: to match this '{'
7 | int main(){
| ^
|
s907938798 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int A, B, C;
char op;
cin << A << op << B;
if(op == '+'){
C = A + B;
} else if(op == '-'){
C =A - B;
}
cout << C;
} | a.cc: In function 'int main()':
a.cc:7:5: 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:5: note: candidate: 'opera... |
s001185262 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int A, B C;
char op;
cin << A << op << B;
if(op == '+'){
C = A + B;
} else if(op == '-'){
C =A - B;
}
cout << C;
} | a.cc: In function 'int main()':
a.cc:5:10: error: expected initializer before 'C'
5 | int A, B C;
| ^
a.cc:7:5: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int')
7 | cin << A << op << B;
| ~~~ ^~ ~
| | |
| | ... |
s173918070 | p03844 | C++ | #include <iostream>
#include <cstdio>
using namespace std;
int main(){
int a;
int b;
int c;
scanf("%d", &a);
scanf("%d", &b);
c = (a + b);
printf("%d\", c);
return 0;
}
| a.cc:12:8: warning: missing terminating " character
12 | printf("%d\", c);
| ^
a.cc:12:8: error: missing terminating " character
12 | printf("%d\", c);
| ^~~~~~~~~~
a.cc: In function 'int main()':
a.cc:13:1: error: expected primary-expression before 'return'
13 | return 0;
| ^~~... |
s454311623 | p03844 | C++ | #include <iostream>
using namespace std;
int main(){
int a, b,
cin >> a >> b;
cout << (a + b) << endl;
}
| a.cc: In function 'int main()':
a.cc:6:5: error: expected initializer before '>>' token
6 | cin >> a >> b;
| ^~
|
s891113421 | p03844 | C++ | a | a.cc:1:1: error: 'a' does not name a type
1 | a
| ^
|
s227395450 | p03844 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int a,b;
char op;
cin>>A>>op>>b;
if(op=='+'){
cout << a+b;
}else{
cout<<a-b;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:7:8: error: 'A' was not declared in this scope
7 | cin>>A>>op>>b;
| ^
|
s802932855 | p03844 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string A,B;
char op;
cin>>A>>op>>B;
int a,b,ans;
if(op=='+'){
a=atoi(A);
b=atoi(B);
ans=a+b;
cout << ans;
}else{
a=atoi(A);
b=atoi(B);
ans=a-b;
cout <<ans;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:11:12: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
11 | a=atoi(A);
| ^
| |
| std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/cstdl... |
s751484465 | p03844 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string A,op,B;
cin>>A>>op>>B;
int a,b,ans;
if(op=='+'){
a=atoi(A);
b=atoi(B);
ans=a+b;
cout << ans;
}else{
a=atoi(A);
b=atoi(B);
ans=a-b;
cout <<ans;
}
return 0;
}
| 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... |
s247403818 | p03844 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
char A,op,B;
cin>>A>>op>>B;
int a,b,ans;
if(op=='+'){
a=atoi(A);
b=atoi(B);
ans=a+b;
cout << ans;
}else{
a=atoi(A);
b=atoi(B);
ans=a-b;
cout <<ans;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:10:12: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
10 | a=atoi(A);
| ^
| |
| char
In file included from /usr/include/c++/14/cstdlib:79,
from /usr/include/x86_64-linux-gnu/c++/14/bits... |
s796307839 | 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:12: error: expected primary-expression before ')' token
8 | if (op==+) {
| ^
|
s315873498 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int F,S;
string op;
cin >> F >> op >> S;
if(op=='+' ){
cout << F+S << endl;
}
else{
cout << F-S << 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 i... |
s991652015 | p03844 | Java | 5 - 7
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.NoSuchElementException;
public class Main {
public static void main(String[] args) throws IOException {
new Main().solve();
}
private void solve() throws IOException {
try {
solveA();
// solveB(... | Main.java:1: error: class, interface, enum, or record expected
5 - 7
^
Main.java:3: error: class, interface, enum, or record expected
import java.io.InputStream;
^
Main.java:4: error: class, interface, enum, or record expected
import java.io.PrintWriter;
^
Main.java:5: error: class, interface, enum, or record expected
... |
s438649249 | p03844 | C++ | a, s, b = map(str, input().split())
a = int(a)
b = int(b)
if s == '+':
print(a + b)
else:
print(a - b)
| a.cc:1:1: error: 'a' does not name a type
1 | a, s, b = map(str, input().split())
| ^
|
s475933942 | p03844 | C++ | #include <iostream>
using namespase 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;
}
return 0;
}
| a.cc:3:7: error: expected nested-name-specifier before 'namespase'
3 | using namespase std;
| ^~~~~~~~~
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 >> op >> B;
| ^~~
| std::cin
In file included from a.... |
s047260176 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int A, B, r;
char op;
cin >> A >> op >> B;
if ( op == '+') r = A + B;
else r = A - B;
cout >> r >> endl;
} | a.cc: In function 'int main()':
a.cc:10:8: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int')
10 | cout >> r >> endl;
| ~~~~ ^~ ~
| | |
| | int
| std::ostream {aka std::basic_ostream<char>}
a.cc:10:8: note: cand... |
s544136065 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int A, B, r;
char op;
cin >> A >> op >> B;
switch (op) {
case '+':
r = A + B;
case '-':
r = A - B;
}
cout >> r >> endl;
} | a.cc: In function 'int main()':
a.cc:14:8: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int')
14 | cout >> r >> endl;
| ~~~~ ^~ ~
| | |
| | int
| std::ostream {aka std::basic_ostream<char>}
a.cc:14:8: note: cand... |
s960789165 | p03844 | C | #include <stdio.h>
int main (){
int n;
int t[101];
int m;
int p[101];
int x[101];
int sum = 0;
int i;
scanf("%d" ,&n);
for( i = 0; i < n; i++) {
scanf("%d" &t[i]);
sum = sum + t[i];
}
scanf("%d" ,&m);
for( i = 0; i < m; i++) {
scanf... | main.c: In function 'main':
main.c:17:20: error: invalid operands to binary & (have 'char *' and 'int')
17 | scanf("%d" &t[i]);
| ~~~~ ^~~~~
| | |
| char * int
|
s875806891 | 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<<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=='+') cout<<A+B<<endl;
| ~~^~~~~
| | |
| | char
| std::string {aka std::__cxx11::basic_string<c... |
s006448620 | 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;
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(op == '+') cout >> A + B >> endl;
| ~~ ^~ ~~~
| | |
| | char
| std::string {aka std::__cxx11::... |
s909792903 | p03844 | C++ | #include <iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<map>
#include<set>
#include<stack>
#include<queue>
#include<math.h>
using namespace std;
typedef long long ll;
#define int long long
typedef vector<int> VI;
#define fore(i,a) for(auto &i:a)
#define REP(i,n) for(int i=0;i<n;i++)
#define e... | a.cc: In function 'int main()':
a.cc:42:15: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
42 | if (s == '-')
| ~ ^~ ~~~
| | |
| | char
| std::string {aka std:... |
s909704943 | p03844 | C++ | #include<iostream>
#include<string>
#include <algorithm>
using namespace std;
int main()
{
int A, B;
char op;
cin >> A >> op >> B;
if(op == "+"){
cout << A + B << endl;
}else{
cout << A - B << endl;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:11:9: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
11 | if(op == "+"){
| ~~~^~~~~~
|
s799850205 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int A,B;
string op;
cin>>A>>op>>B;
cout<<A op B<<endl;
} | a.cc: In function 'int main()':
a.cc:8:16: error: expected ';' before 'op'
8 | cout<<A op B<<endl;
| ^~~
| ;
|
s708177682 | p03844 | C++ | #include<iostream>
#include<cstdio>
#include<vector>
#include<queue>
#include<map>
#include<unordered_map>
#include<stack>
#include<string>
#include<algorithm>
#include<functional>
#include<cstring>
#include<utility>
#include<bits/stdc++.h>
#include<math.h>
using namespace std;
/**** Type Define ****/
typedef long lo... | a.cc: In function 'int main()':
a.cc:182:14: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
182 | if(op=='+'){
| ~~^~~~~
| | |
| | char
| std::string {aka std::__cxx1... |
s315196121 | p03844 | C++ | #include<bits/stdc++.h>
using namespace std;
using Int = long long;
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
... | a.cc: In function 'int main()':
a.cc:15:8: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
15 | if (op == '+') {
| ~~ ^~ ~~~
| | |
| | char
| std::string {aka std::__cxx11::basic_string<char>}
In fi... |
s240314507 | p03844 | Java | /*
この問題はABC_50_Aである
opが"+"ならaとbを足し、"-"ならaとbを引く
*/
import java.util.*;
public class Addition_and_Subtraction_Easy{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
String op = sc.next();
int b = sc.nextInt();
String plus = "+";
String minus = "... | Main.java:7: error: class Addition_and_Subtraction_Easy is public, should be declared in a file named Addition_and_Subtraction_Easy.java
public class Addition_and_Subtraction_Easy{
^
1 error
|
s326428162 | p03844 | C++ | /*
この問題はABC_50_Aである
opが"+"ならaとbを足し、"-"ならaとbを引く
*/
import java.util.*;
public class Addition_and_Subtraction_Easy{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
String op = sc.next();
int b = sc.nextInt();
String plus = "+";
String minus = "... | a.cc:5:1: error: 'import' does not name a type
5 | import java.util.*;
| ^~~~~~
a.cc:5:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:7:1: error: expected unqualified-id before 'public'
7 | public class Addition_and_Subtraction_Easy{
| ^~~~~~
|
s741588460 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
#define cinf(n,x) for(int i=0;i<(n);I++) cin >> x[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: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<char... |
s379288596 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
#define FOR(i,n) for(int i=0;i<n;i++)
#define why(n,x) int n;while(cin >>n,n!=x)
#define iFOR(i,x,n)for(int i=x;i<n;i++)
#define unless(flg) if ( !(flg) )
#define read cin<<
#define echo cout<<
#define fin <<'\n'
#define __ <<" "<<
#define ___ <<" "
#define bash push_back
#... | a.cc: In function 'int main()':
a.cc:48:20: error: expected primary-expression before '>' token
48 | cin >> a >> gl > >b;
| ^
|
s469088246 | p03844 | C++ | #include<iostream>
#include<cmath>
#include<vector>
#include<set>
#include<algorithm>
#include<tuple>
#include<utility>
#include<cctype>
#include<climits>
#include<map>
#include<queue>
#include<functional>
#include <ios>
#include <iomanip>
using namespace std;
template<class T> void chmax(T& a, T b) {if(a < b){a=b;}}
... | a.cc: In function 'int atcoder()':
a.cc:38:9: error: could not convert 'b.std::__cxx11::basic_string<char>::operator=(((const char*)"+"))' from 'std::__cxx11::basic_string<char>' to 'bool'
38 | if(b="+") cout << a+c << ENT;
| ~^~~~
| |
| std::__cxx11::basic_string<char>
|
s859559706 | p03844 | C++ | #include<iostream>
#include<cmath>
#include<vector>
#include<set>
#include<algorithm>
#include<tuple>
#include<utility>
#include<cctype>
#include<climits>
#include<map>
#include<queue>
#include<functional>
#include <ios>
#include <iomanip>
using namespace std;
template<class T> void chmax(T& a, T b) {if(a < b){a=b;}}
... | a.cc: In function 'int atcoder()':
a.cc:36:5: error: expected initializer before 'cin'
36 | cin >> a >> b >> c;
| ^~~
a.cc:38:8: error: 'b' was not declared in this scope
38 | if(b="+") cout << a+c << ENT;
| ^
|
s025993237 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main () {
int A, B;
cin >> A >> B;
char op;
cin >> op;
if ( op == +) {
cout << A+B << endl;
}
if ( op == - ) {
cout << A-B << endl;
}
} | a.cc: In function 'int main()':
a.cc:10:15: error: expected primary-expression before ')' token
10 | if ( op == +) {
| ^
a.cc:13:16: error: expected primary-expression before ')' token
13 | if ( op == - ) {
| ^
|
s216121346 | 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;
}
} | a.cc: In function 'int main()':
a.cc:9:15: error: expected primary-expression before ')' token
9 | if ( op == +) {
| ^
a.cc:12:16: error: expected primary-expression before ')' token
12 | if ( op == - ) {
| ^
|
s460096151 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main () {
int A, B;
cin >> A >> B;
string op;
if ( op == +) {
cout << A op B << endl;
}
if ( op == - ) {
cout << A op B << endl;
}
} | a.cc: In function 'int main()':
a.cc:9:15: error: expected primary-expression before ')' token
9 | if ( op == +) {
| ^
a.cc:10:14: error: expected ';' before 'op'
10 | cout << A op B << endl;
| ^~~
| ;
a.cc:12:16: error: expected primary-expression ... |
s767753144 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main () {
int A, B;
cin >> A >> B;
if ( op == +) {
cout << A op B << endl;
}
if ( op == - ) {
cout << A op B << endl;
}
} | a.cc: In function 'int main()':
a.cc:8:8: error: 'op' was not declared in this scope
8 | if ( op == +) {
| ^~
a.cc:8:15: error: expected primary-expression before ')' token
8 | if ( op == +) {
| ^
a.cc:9:14: error: expected ';' before 'op'
9 | cout << A op B << endl;... |
s763366336 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int a,b;
string op;
cin >>a >> op >> b;
if (op = "+"){
cout << a+b << endl;
}else{
cout << a-b << endl;
}
} | a.cc: In function 'int main()':
a.cc:8:10: error: could not convert 'op.std::__cxx11::basic_string<char>::operator=(((const char*)"+"))' from 'std::__cxx11::basic_string<char>' to 'bool'
8 | if (op = "+"){
| ~~~^~~~~
| |
| std::__cxx11::basic_string<char>
|
s086808680 | p03844 | C | #include <stdio.h>
int main(void){
int a,b;
char c[1];
scanf("%d %c &d",&a,&c,&b);
if(char[0]=='+'){printf("%d\n",a+b);}
else{printf("%d\n",a-b);}
return 0;
} | main.c: In function 'main':
main.c:6:4: error: expected expression before 'char'
6 | if(char[0]=='+'){printf("%d\n",a+b);}
| ^~~~
|
s718228595 | p03844 | C | #include <stdio.h>
int main(void){
int a,b
char c[1];
scanf("%d %c &d",&a,%c,&b);
if(char[0]=='+'){printf("%d\n",a+b);}
else{printf("%d\n",a-b);}
return 0;
} | main.c: In function 'main':
main.c:4:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'char'
4 | char c[1];
| ^~~~
main.c:5:21: error: expected expression before '%' token
5 | scanf("%d %c &d",&a,%c,&b);
| ^
main.c:6:4: error: expected expression before 'char'
... |
s794913699 | p03844 | C | include <stdio.h>
int main(void){
int a,b
char c[1];
scanf("%d %c &d",&a,%c,&b);
if(char[0]=='+'){printf("%d\n",a+b);}
else{printf("%d\n",a-b);}
return 0;
} | main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
1 | include <stdio.h>
| ^
|
s000041443 | p03844 | C++ | #include<iostream>
using namespace std;
int main(){int a,b;
string op;
cin>> a >> op >> b; if(op == "+")
else
cout << a + b << endl; cout << a - b << endl;} | a.cc: In function 'int main()':
a.cc:7:1: error: expected primary-expression before 'else'
7 | else
| ^~~~
|
s285454848 | p03844 | C++ | #include<iostream>
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:7:5: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int')
7 | cin << a << s << b;
| ~~~ ^~ ~
| | |
| | int
| std::istream {aka std::basic_istream<char>}
a.cc:7:5: note: candidate: 'operat... |
s938572355 | p03844 | C++ | #include<iostream>
using namespace std;
int main(){
int a, b;
string s;
cin << a << b;
cin << s ;
if (s == '+'){
cout >> a+ b >> endl;}
else{
cout >> a - b >> endl;
} }
| a.cc: In function 'int main()':
a.cc:7:5: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int')
7 | cin << a << b;
| ~~~ ^~ ~
| | |
| | int
| std::istream {aka std::basic_istream<char>}
a.cc:7:5: note: candidate: 'operator<<(... |
s611191875 | p03844 | C++ | #include<iostream>
using namespace std;
int main(){
int a, b;
char s;
cin << a << b;
cin << s ;
if (s == '+'){
cout >> a+ b >> endl;}
else{
cout >> a - b >> endl;
}
return 0;}
| a.cc: In function 'int main()':
a.cc:7:5: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int')
7 | cin << a << b;
| ~~~ ^~ ~
| | |
| | int
| std::istream {aka std::basic_istream<char>}
a.cc:7:5: note: candidate: 'operator<<(... |
s248577153 | p03844 | C++ | #include<iostream>
using namespace std;
int main(){
int a, b;
char s;
cin << a << b;
cin << s ;
if (s == '+'){
cout >> a+ b >> endl;}
else{
cout >> a - b >> endl;
} } | a.cc: In function 'int main()':
a.cc:7:5: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int')
7 | cin << a << b;
| ~~~ ^~ ~
| | |
| | int
| std::istream {aka std::basic_istream<char>}
a.cc:7:5: note: candidate: 'operator<<(... |
s291743899 | p03844 | C++ | #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#define For(i, n) for(int i = 0; i < (n); i ++)
#define Range(c) c.begin(), c.end()
#define RevRange(c) c.begin(), c.end()
#define Cin(T, x) T x; cin >> x;
#define Cins(T, n, xs) vector<T> xs(n); For(i, n) cin >> xs[i];
#define Cout(val) cout ... | a.cc: In function 'int main()':
a.cc:22:24: error: no match for 'operator+' (operand types are 'int' and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
22 | Cout((b == "+") ? a+b : a-b);
| ~^~
| | |
| | std::string {aka ... |
s994744453 | p03844 | Java | import java.util.*;
class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int x,y;
String str;
x = sc.nextInt();
str = sc.nextString();
y = sc.nextInt();
if(str == "+"){
System.out.println(x+y);
}
else{
System.out.println(x-y);
}
... | Main.java:9: error: cannot find symbol
str = sc.nextString();
^
symbol: method nextString()
location: variable sc of type Scanner
1 error
|
s396993715 | p03844 | Java | import java.util.*;
class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int x,y;
char c;
x = sc.nextInt();
c = sc.nextChar();
y = sc.nextInt();
if(c == "+"){
System.out.println(x+y);
}
else{
System.out.println(x-y);
}
}
} | Main.java:9: error: cannot find symbol
c = sc.nextChar();
^
symbol: method nextChar()
location: variable sc of type Scanner
Main.java:11: error: bad operand types for binary operator '=='
if(c == "+"){
^
first type: char
second type: String
2 errors
|
s201037897 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int A, B;
string c;
cin >> A >> c >> B;
if(c == '+')
cout << A + B << endl;
if(c == '-')
cout << A - B << endl;
} | a.cc: In function 'int main()':
a.cc:7:8: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
7 | if(c == '+')
| ~ ^~ ~~~
| | |
| | char
| std::string {aka std::__cxx11::basic_string<char>}
In file... |
s255151472 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int A,B;
char op;
cin >> A>>op>>B;
if(op=='+')
cout << A+B;
if(op=='-')
cout << A-B; | a.cc: In function 'int main()':
a.cc:11:15: error: expected '}' at end of input
11 | cout << A-B;
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s414780940 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main()
{
int a, b;
char s;
sin >> a >> s >> b;
if(s == '+')
cout << a + b << endl;
else
cout << a - b << endl;
} | a.cc: In function 'int main()':
a.cc:8:13: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator>>'
8 | sin >> a >> s >> b;
| ~~~~^~~~
|
s176272152 | 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{printf("%d",a-b);}
return 0;
} | main.c:1:9: fatal error: Stdio.h: No such file or directory
1 | #include<Stdio.h>
| ^~~~~~~~~
compilation terminated.
|
s706198601 | p03844 | C++ | #include<iostream>
#include<string>
#include<vector>
#include<iomanip>
#include<algorithm>
#include<queue>
#include<stack>
#include<map>
using namespace std;
#define ll long long
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:15:10: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
15 | if(op=='+')cout<<a+b;else cout <<a-b;
| ~~^~~~~
| | |
| | char
| std::string {aka std::__... |
s000878492 | p03844 | C++ | #include <iostream>
#include <stdlib.h>
int main(void){
char a,b,c;
cin >> a >> b >> c;
if(b=='+'){
cout << atoi(a) + atoi(c) << endl;
}else{
cout << atoi(a) - atoi(c) << endl;
}
} | 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 >> c;
| ^~~
| 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... |
s948713428 | p03844 | C++ | #include <iostream>
#include <algorithm>
#include <math.h>
#include <string>
using namespace std;
int main(){
int A,B, C, D ,E ,F;
string S,Sa,Sb,Sc;
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:10:8: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
10 | if(S == '+')cout << A + B << endl;
| ~ ^~ ~~~
| | |
| | char
| std::string {aka std::__cxx11::basi... |
s953995367 | p03844 | C | #include <stdio.h>
int main(){
int a,b;
char o[2];
scanf("%d%c%d",&a,&o,%b);
if(o=='+')
printf("%d",a+b);
else
printf("%d",a-b);
return 0;
} | main.c: In function 'main':
main.c:5:24: error: expected expression before '%' token
5 | scanf("%d%c%d",&a,&o,%b);
| ^
main.c:6:7: warning: comparison between pointer and integer
6 | if(o=='+')
| ^~
|
s905541965 | 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:7: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int')
8 | cin << a << op << b ;
| ~~~ ^~ ~
| | |
| | int
| std::istream {aka std::basic_istream<char>}
a.cc:8:7: note: candid... |
s738178791 | p03844 | C | #include <iostream>
using namespace std;
int main(void){
long a, b;
char c;
cin>>a>>c>>b;
if(c=='+')
cout<<a+b<<endl;
else
cout<<a-b<<endl;
return 0;
} | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s524300157 | p03844 | C | #include <iostream>
using namespace std;
int main(void){
int a, b;
char c;
cin>>a>>c>>b;
if(c=='+')
cout<<a+b<<endl;
else
cout<<a-b<<endl;
return 0;
} | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s824154356 | p03844 | C++ | #include <stdio.h>
int a,b;
char op;
int main()
{
scanf("%d %c %d",&a,%op,&b);
if(op == '+') a+=b;
else a-=b;
printf("%d",a);
return 0;
} | a.cc: In function 'int main()':
a.cc:8:23: error: expected primary-expression before '%' token
8 | scanf("%d %c %d",&a,%op,&b);
| ^
|
s953039867 | p03844 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <cmath>
#include <cstring>
#include <iomanip>
#include <random>
#include <chrono>
#include <queue>
using namespace std;
typedef long long ll;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;
#define INF 1000000000
#de... | a.cc: In function 'int main()':
a.cc:26:13: error: 's' was not declared in this scope
26 | cout << s << endl;
| ^
|
s934770526 | p03844 | C++ |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define fw(p) for(int w=0;w<(p);w++)
#define fx(p) for(int x=0;x<(p);x++)
#define fy(p) for(int y=0;y<(p);y++)
#define fz(p) for(int z=0;z<(p);z++)
#define fyg(p,g) for(int y=(g);y<(p);y++)
#define fzg(p,g) for(int z=(g);z<(p);z++)
#define ce(d) cout... | a.cc: In function 'int main()':
a.cc:41:16: error: found ':' in nested-name-specifier, expected '::'
41 | char op:
| ^
| ::
a.cc:41:14: error: 'op' has not been declared
41 | char op:
| ^~
a.cc:42:12: error: qualified-id in declaration b... |
s984386684 | p03844 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
str 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:4:9: error: 'str' was not declared in this scope; did you mean 'std'?
4 | str b;
| ^~~
| std
a.cc:6:17: error: 'b' was not declared in this scope
6 | cin>>a>>b>>c;
| ^
|
s153743983 | p03844 | C++ | astr, op, bstr = input().split()
a = int(astr)
b = int(bstr)
if op == '+':
print(a + b)
elif op == '-':
print(a - b)
| a.cc:1:1: error: 'astr' does not name a type
1 | astr, op, bstr = input().split()
| ^~~~
|
s220100873 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[])
{
int A;
int B;
char op;
cin>>A>>op>>B;
int C=A+B;
int D=A-B;
if (op=='+') {
cout<<C
}
else
{
cout<<D;
}
return 0;
} | a.cc: In function 'int main(int, const char**)':
a.cc:15:16: error: expected ';' before '}' token
15 | cout<<C
| ^
| ;
16 | }
| ~
|
s180079008 | p03844 | C++ | #include "stdafx.h"
#include <iostream>
using namespace std;
int main(void)
{
int a;
int b;
string c;
cin >> a;
cin >> c;
if (c == "+") {
cin >> b;
cout << a + b << endl;
}
else {
cin >> b;
cout << a - b << endl;
}
return 0;
}
| a.cc:1:10: fatal error: stdafx.h: No such file or directory
1 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s107890404 | p03844 | C++ | #include <iostream>
using namespace std;
int main(){
| a.cc: In function 'int main()':
a.cc:5:12: error: expected '}' at end of input
5 | int main(){
| ~^
|
s623431831 | p03844 | C++ | #include <iostream>
using namespace std;
int main(void)
{
int a;
int b;
string c;
cin >> a;
cin >> c;
if(c=="+"){
cin >> b;
cout << a+b << endl;
}else{
cin >> b;
cout << a-b << endl
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:18:28: error: expected ';' before '}' token
18 | cout << a-b << endl
| ^
| ;
19 | }
| ~
|
s982824144 | p03844 | C++ | int main()
{
int A, B;
char OP;
//文字入力
scanf("%d", &A);
scanf("%c", &OP);
scanf("%d", &B);
switch (OP) {
case '+' :A+= B;break;
case '-':A -= B; break;
}
printf("%d", A );
return 0;
}
| a.cc: In function 'int main()':
a.cc:6:17: error: 'scanf' was not declared in this scope
6 | scanf("%d", &A);
| ^~~~~
a.cc:13:17: error: 'printf' was not declared in this scope
13 | printf("%d", A );
| ^~~~~~
a.cc:1:1: note: 'printf' is ... |
s680411507 | p03844 | C | // 競技プログラミング.cpp : アプリケーションのエントリ ポイントを定義します。
//
#include "stdafx.h"
int main()
{
while (true)
{
int A, B;
char OP;
//文字入力
scanf("%d", &A);
scanf("%c", &OP);
scanf("%d", &B);
switch (OP) {
case '+' :A+= B;break;
case '-':A -= B; break;
}
printf("%d", A );
}
return 0;
}
| main.c:4:10: fatal error: stdafx.h: No such file or directory
4 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s888859436 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
long long A, B;
char op;
cin >> A >> op >> B;
if (op=='+') cout << A + B << endl;
else (op=='-') cout << A - B << endl;
} | a.cc: In function 'int main()':
a.cc:9:17: error: expected ';' before 'cout'
9 | else (op=='-') cout << A - B << endl;
| ^~~~~
| ;
|
s232601522 | 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;
}
if (op == "-"){
ans = a - b;
}
cout << ans << endl;
}z | a.cc:18:2: error: 'z' does not name a type
18 | }z
| ^
|
s677988491 | p03844 | C++ | #include <iostream>
using namespace std;
int main(){
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:6:13: error: 'op' was not declared in this scope
6 | cin >> a >> op >> b;
| ^~
|
s394383501 | p03844 | C++ | #include <iostream>
using namespace std;
int main(void){
int a,b;
char c;
cin >> a >> c >> b;
cout << (c == "+" ? a + b : a - b) << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:11:14: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
11 | cout << (c == "+" ? a + b : a - b) << endl;
| ~~^~~~~~
|
s903361814 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int a,b,c;
char op;
cin >> a >> op >> b;
if (op == "+"){
c = a + b;
}
else {
c = a - b;
}
cout << c <<endl;
} | a.cc: In function 'int main()':
a.cc:8:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
8 | if (op == "+"){
| ~~~^~~~~~
|
s851341225 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int a,b,c;
char op;
cin >> a >> op >> b;
if(op == "+"){
c = a + b;
}
else {
c = a - b;
}
cout << c <<endl;
} | a.cc: In function 'int main()':
a.cc:8:9: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
8 | if(op == "+"){
| ~~~^~~~~~
|
s247272654 | p03844 | C++ | #include<iostream>
using namespace std;
int main(){
int a,o,b;
cin>>a>>o>>b;
cout<<(o=="+"?a+b;a-b);
return 0;
}
| a.cc: In function 'int main()':
a.cc:7:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
7 | cout<<(o=="+"?a+b;a-b);
| ~^~~~~
a.cc:7:20: error: expected ':' before ';' token
7 | cout<<(o=="+"?a+b;a-b);
| ^
| :
a.... |
s981146112 | p03844 | C++ | #include <cstdio>
#include <iostream>
using namespace std;
int A, B;
char op;
int main() {
cin >> A >> op >> B;
if (op == '+') {
cout << A + B;
}
else cout << A - B;
| a.cc: In function 'int main()':
a.cc:15:28: error: expected '}' at end of input
15 | else cout << A - B;
| ^
a.cc:9:12: note: to match this '{'
9 | int main() {
| ^
|
s126578248 | p03844 | C++ | #include <cstdo>
#include <iostream>
using namespace std;
int A, B;
char op;
int main(){
cin >> A >> op >> B;
if (op = '+') {
cout << A + B;
}
else cout << A - B;
} | a.cc:1:10: fatal error: cstdo: No such file or directory
1 | #include <cstdo>
| ^~~~~~~
compilation terminated.
|
s543455351 | p03844 | C++ |
#include "pch.h"
#include <iostream>
using namespace std;
int A, B;
char op;
int main(){
cin >> A >> op >> B;
if (op = '+') {
cout << A + B;
}
else cout << A - B;
}
| a.cc:2:10: fatal error: pch.h: No such file or directory
2 | #include "pch.h"
| ^~~~~~~
compilation terminated.
|
s633300564 | p03844 | C++ | #include<bits/stdc++.h>
using namespace std;
int main() {
int a, b;
char s;
cin >> a >> c >> b;
if (c == '+') {
cout << a + b << endl;
}
else {
cout << a - b << endl;;
}
} | a.cc: In function 'int main()':
a.cc:6:21: error: 'c' was not declared in this scope
6 | cin >> a >> c >> b;
| ^
|
s189540618 | p03844 | C++ | #include<iostream>
#include<vector>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<string>
#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main(){
ll 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:15:9: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
15 | if(op == '+') cout << a + b << endl;
| ~~ ^~ ~~~
| | |
| | char
| std::string {aka std::__cxx11:... |
s495598250 | p03844 | C++ | #include<iostream>
using namespace std;
int main(){
int a,b
string str;
cin >> a >> str >> b;
if(str[0] == '+'){
cout << a + b << '\n';
}
else{
cout << a - b << '\n';
}
return 0;
} | a.cc: In function 'int main()':
a.cc:6:5: error: expected initializer before 'string'
6 | string str;
| ^~~~~~
a.cc:8:17: error: 'str' was not declared in this scope; did you mean 'std'?
8 | cin >> a >> str >> b;
| ^~~
| std
a.cc:8:24: error: 'b' was... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.