submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s495822002 | p03844 | C++ | //
// Created by 伊東麻沙美 on 2019/10/22.
//
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
int i,j;
char x;
cin<<i<<x<<j;
if(x=='+'){
printf("%d",i+j);
}
if(x=='-'){
printf("%d",i-j);
}
return 0;
} | a.cc: In function 'int main()':
a.cc:14:8: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int')
14 | cin<<i<<x<<j;
| ~~~^~~
| | |
| | int
| std::istream {aka std::basic_istream<char>}
a.cc:14:8: note: candidat... |
s803436431 | 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 if (op == '-')
{
ans = a - b;
}
cout << ans << 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:7:9: error: 'cin' was not declared in this scope
7 | cin >> a >> op >> b;
| ^~~
a.cc:18:9: error: 'cout' was not declared in this scope
18 | cout << a... |
s712303883 | p03844 | C++ | #include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main(){
int a,b;
string c;
cin>>a>>c>>b;
(c='+')? cout<<a+b:cout<<a-b;
return 0;
}
| a.cc: In function 'int main()':
a.cc:11:5: error: could not convert 'c.std::__cxx11::basic_string<char>::operator=(43)' from 'std::__cxx11::basic_string<char>' to 'bool'
11 | (c='+')? cout<<a+b:cout<<a-b;
| ~~^~~~~
| |
| std::__cxx11::basic_string<char>
|
s164934566 | p03844 | C++ | #include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main(){
int a,b;
string c;
cin>>a>>c>>b;
(c=='+')? cout<<a+b:cout<<a-b;
return 0;
}
| a.cc: In function 'int main()':
a.cc:11:5: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
11 | (c=='+')? cout<<a+b:cout<<a-b;
| ~^~~~~
| | |
| | char
| std::string {aka std::__cxx11::basic_string<char>}
In... |
s743101281 | p03844 | C++ | #include<iostream>
using namespace std;
int main(){
int a,b;
char c;
cin >> a >> c >> b;
if (c=="+"){
return a+b;
}else{
return a-b;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:7:8: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
7 | if (c=="+"){
| ~^~~~~
|
s372811422 | p03844 | C++ | #include<stdio.h>
int main()
{
long long int A,B;
char C;
scanf("%lld %c %lld", &A , &C, &B);
if(C=='+')
printf("%d\n",A+B);
else if(C=='-')
printf("%d\n",A-B);
else
return;
}
| a.cc: In function 'int main()':
a.cc:14:13: error: return-statement with no value, in function returning 'int' [-fpermissive]
14 | return;
| ^~~~~~
|
s700389807 | p03844 | C++ | #include<iosteram>
using namespace std;
int main(){
int a,b;
char c;
cin >> a >> c >> b;
if(c == '-') cout << a-b;
else cout << a+b;
} | a.cc:1:9: fatal error: iosteram: No such file or directory
1 | #include<iosteram>
| ^~~~~~~~~~
compilation terminated.
|
s985657817 | p03844 | C++ | #include <bits/stdc++.h>
#define REP(i, n) for(ll i = 0; i < (ll)n; i++)
#define FOR(i, a, b) for(ll i = (a); i < (ll)b; i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define INF (1ll << 60)
#define sz(x) int(x.size())
using namespace std;
typedef long long ll;
using vl = vector<ll>;
using vvl = vector<vl>;
typedef ... | a.cc: In function 'int main()':
a.cc:39:17: error: 'cp' was not declared in this scope; did you mean 'op'?
39 | cin >> A >> cp >> B;
| ^~
| op
|
s673855840 | p03844 | C++ | #include <bits/stdc++.h>
#define REP(i, n) for(ll i = 0; i < (ll)n; i++)
#define FOR(i, a, b) for(ll i = (a); i < (ll)b; i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define INF (1ll << 60)
#define sz(x) int(x.size())
using namespace std;
typedef long long ll;
using vl = vector<ll>;
using vvl = vector<vl>;
typedef ... | a.cc: In function 'int main()':
a.cc:39:17: error: 'cp' was not declared in this scope; did you mean 'op'?
39 | cin >> A >> cp >> B;
| ^~
| op
a.cc:42:9: error: 'reutrn' was not declared in this scope
42 | reutrn 0;
| ^~~~~~
|
s967205708 | p03844 | C++ | #include <bits/stdc++.h>
#define REP(i, n) for(ll i = 0; i < (ll)n; i++)
#define FOR(i, a, b) for(ll i = (a); i < (ll)b; i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define INF (1ll << 60)
#define sz(x) int(x.size())
using namespace std;
typedef long long ll;
using vl = vector<ll>;
using vvl = vector<vl>;
typedef ... | a.cc: In function 'int main()':
a.cc:39:13: error: 'cp' was not declared in this scope; did you mean 'op'?
39 | cin>>A>>cp>>B;
| ^~
| op
a.cc:41:18: error: no match for 'operator<<' (operand types are 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} ... |
s422459342 | p03844 | C++ | #include<iostream>
using namespace std;
int main(){
int a, b;
char op;
cin >> a >> op >> b;
int ans;
if(op == '+'
ans = a+b;
else
ans = a-b;
cout << ans;
return 0;
} | a.cc: In function 'int main()':
a.cc:9:15: error: expected ';' before 'ans'
9 | if(op == '+'
| ^
| ;
10 | ans = a+b;
| ~~~
a.cc:11:3: error: expected primary-expression before 'else'
11 | else
| ^~~~
a.cc:10:15: error: expected ')' befo... |
s537997065 | p03844 | C | #include<stdio.h>
int main()
{
long long int a, b;
char ch;
scanf("%lld", &a);
scanf("%c", &ch);
scanf("%lld", &b);
if (ch == '+') {
printf("%lld\n", a + b);
}
else if {
printf("%lld\n", a - b);
}
return 0;
} | main.c: In function 'main':
main.c:14:18: error: expected '(' before '{' token
14 | else if {
| ^
| (
|
s251304780 | p03844 | C | #include<stdio.h>
int main()
{
int a, b;
char s;
scanf("%d", &a);
scanf("%c", &s);
scanf("%d", &b);
if (s == +) {
printf("%d\n", a + b);
}
if (s == -) {
printf("%d\n", a - b);
}
return 0;
} | main.c: In function 'main':
main.c:11:19: error: expected expression before ')' token
11 | if (s == +) {
| ^
main.c:14:19: error: expected expression before ')' token
14 | if (s == -) {
| ^
|
s093547700 | p03844 | Java | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int num1 = Integer.parseInt(sc.next());
String op = sc.next();
int num1 = Integer.parseInt(sc.next());
if ("+".equals(op)) {
System.out.println(num1 + num... | Main.java:8: error: variable num1 is already defined in method main(String[])
int num1 = Integer.parseInt(sc.next());
^
Main.java:10: error: cannot find symbol
System.out.println(num1 + num2);
^
symbol: variable num2
location: class Main
Main.java:12... |
s790008670 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int a;
string op;
int b;
if (op == '+') {
cout << a+b<< endl;
} else {
cout << a-b << endl;
}
} | a.cc: In function 'int main()':
a.cc:8:10: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
8 | if (op == '+') {
| ~~ ^~ ~~~
| | |
| | char
| std::string {aka std::__cxx11::basic_string<ch... |
s053139527 | 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;
else{
cout<<A-B<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:10:5: error: expected '}' before 'else'
10 | else{
| ^~~~
a.cc:8:13: note: to match this '{'
8 | if(op = '+'){
| ^
|
s500585166 | 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;
else {
cout<<a-b;
| a.cc: In function 'int main()':
a.cc:10:15: error: expected '}' at end of input
10 | cout<<a-b;
| ^
a.cc:9:6: note: to match this '{'
9 | else {
| ^
a.cc:10:15: error: expected '}' at end of input
10 | cout<<a-b;
| ^
a.cc:3:12: note: to match this '{'... |
s704502828 | p03844 | C++ | #include<iostream>
#define rep(i,n) for(int i=0; i<(n); i++)
using namespace std;
typedef long long ll;
int main(){
string S;
int a, b;
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:9: error: could not convert 'S.std::__cxx11::basic_string<char>::operator=(43)' from 'std::__cxx11::basic_string<char>' to 'bool'
10 | if(S='+'){
| ~^~~~
| |
| std::__cxx11::basic_string<char>
|
s959055815 | p03844 | C++ | #include <iostream>
#include <iomanip>
#include <vector>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <cstring>
#include <map>
#define rep(i, N) for (int i = 0; i < (int)N; i++)
using namespace std;
typedef long long ll;
const ll LLINF = 9223372036854775807;
const int MOD = 1000000007;
int main()... | a.cc: In function 'int main()':
a.cc:18:22: error: expected primary-expression before '==' token
18 | int result = string=="+" ? A+B : A-B;
| ^~
|
s707570875 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
typedef long long ll;
int main() {
int A, B;
char op;
cin >> A >> op >> b;
if (op == '+'){
cout << A + B << endl;
}
else {
... | a.cc: In function 'int main()':
a.cc:10:23: error: 'b' was not declared in this scope
10 | cin >> A >> op >> b;
| ^
|
s470829938 | 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:16: error: expected ';' before '}' token
11 | cout << A - B
| ^
| ;
12 | }
| ~
|
s519599261 | p03844 | C++ | using namespace std;
int main(){
int a, b;
char c;
cin >> a >> c >> b;
if(c == 'char') cout << a + b << endl;
else cout << a - b << endl;
return 0;
} | a.cc:7:11: warning: multi-character character constant [-Wmultichar]
7 | if(c == 'char') cout << a + b << endl;
| ^~~~~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
6 | cin >> a >> c >> b;
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header... |
s545130557 | p03844 | C++ | using namespace std;
int main(){
int a, b;
string 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:5:3: error: 'string' was not declared in this scope
5 | string c;
| ^~~~~~
a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
+++ |+#include <string>
1 | using namespace std;
a.cc:6:3: error: 'cin... |
s345318303 | p03844 | C++ | using namespace std;
int main(){
int a, b;
string 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:5:3: error: 'string' was not declared in this scope
5 | string c;
| ^~~~~~
a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
+++ |+#include <string>
1 | using namespace std;
a.cc:6:3: error: 'cin... |
s671028568 | p03844 | C++ | #include <bits/stdc++.h>
#define rep(i, a, n) for (int i = (int)(a); i <= (int)(n); ++i)
#define rrep(i, a, n) for (int i = (int)(a); i >= (int)(n); --i)
#define debug(x) cerr << #x << " = " << x << "\n"
#define debugv(x) \
rep(f, 0, (x.size() - 1)) cerr << x[f] << (f == (x.size() - 1) ? "\n" : " ")
#define all(x) x.... | a.cc: In function 'void solve()':
a.cc:24:9: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
24 | if (S == '+') {
| ~ ^~ ~~~
| | |
| | char
| std::string {aka std::__cxx11::basic_string<char... |
s629106273 | 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;
}
} | a.cc: In function 'int main()':
a.cc:5:10: error: found ':' in nested-name-specifier, expected '::'
5 | char op:
| ^
| ::
a.cc:5:8: error: 'op' has not been declared
5 | char op:
| ^~
a.cc:6:7: error: qualified-id in declaration before '>>' token
6 | cin >> A... |
s824196001 | 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:8:11: error: expected primary-expression before ')' token
8 | if(op == +){
| ^
a.cc:11:16: error: expected primary-expression before ')' token
11 | else if(op == -){
| ^
|
s554441807 | p03844 | C++ | #include<bits/stdc++.h>
using namespace std;
int a,b;
string c;
int main(){
cin>>a>>c>>b;
if(c=='+')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::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
7 | if(c=='+')cout<<a+b<<endl;
| ~^~~~~
| | |
| | char
| std::string {aka std::__cxx11::basic_string<char>}
In file i... |
s585444121 | p03844 | C++ | #include<iostream>
using namespace std;
int main(){
int a,b;
char p;
cin>>a>>p>>b;
if(p=="+")
cout<<a+b;
else
cout<<a-b;
return 0;
} | a.cc: In function 'int main()':
a.cc:8:7: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
8 | if(p=="+")
| ~^~~~~
|
s571760874 | p03844 | C++ | #include<bits/stc++.h>
using namespace std;
#define int long long
#define sz(x) (int)(x.size())
signed main() {
int a, op, b;
cin >> a >> op >> b;
if (op == '+') cout << a + b << "\n";
else cout << a - b << "\n";
}
| a.cc:1:9: fatal error: bits/stc++.h: No such file or directory
1 | #include<bits/stc++.h>
| ^~~~~~~~~~~~~~
compilation terminated.
|
s455181792 | 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:12: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
7 | if(op == '+') cout << a + b << endl;
| ~~ ^~ ~~~
| | |
| | char
| std::string {ak... |
s717059404 | p03844 | C++ | #include <bits/stdc++.h>
using namespace::std;
int main(){
int a,b;
string op;
cin>>a>>op>>b;
cout<<op=="+"?a+b:a-b;
}
| a.cc: In function 'int main()':
a.cc:7:11: error: no match for 'operator==' (operand types are 'std::basic_ostream<char>' and 'const char [2]')
7 | cout<<op=="+"?a+b:a-b;
| ~~~~~~~~^~~~~
| | |
| | const char [2]
| std::basic_ostream<char>
In file included from /... |
s534088969 | p03844 | C++ | #include <bits/stdc++.h>
int main(){
int a,b;
string op;
cin>>a>>op>>b;
cout<<op=="+"?a+b:a-b;
} | a.cc: In function 'int main()':
a.cc:4:3: error: 'string' was not declared in this scope
4 | string op;
| ^~~~~~
a.cc:4:3: note: suggested alternatives:
In file included from /usr/include/c++/14/string:41,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux... |
s639979111 | p03844 | C | #include <stdio.h>
int main(void)
{
int num1;
char num2;
int num3;
scanf_s("%d %c %d",num1,num2,num3);
if(num2 == '+'){
printf("%d\n",num1 + num3);
}
else if(num2 == '-'){
printf("%d\n",num1 - num3);
}
return 0;
} | main.c: In function 'main':
main.c:9:3: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
9 | scanf_s("%d %c %d",num1,num2,num3);
| ^~~~~~~
| scanf
|
s662138942 | p03844 | C++ | #include<iostream>
using namespace std;
int main()
{
int a;
char op;
int b;
std::cin >> a;
std::cin >> op;
std::cin >> b;
if ( op == "+") {
std::cout << a+b << '\n';
/* code */
}
else {
std::cout << a-b << '\n';
}
... | a.cc: In function 'int main()':
a.cc:12:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
12 | if ( op == "+") {
| ~~~^~~~~~
|
s344274126 | p03844 | C | int main(void)
{
int num1;
char str[10];
char str1[10];
char str2[10];
int num3;
fgets(str,10,stdin);
sscanf(str,"%d", &num1);
fgets(str,10,stdin);
fgets(str2, 10, stdin);
sscanf(str2,"%d", &num3);
if (str1 == '+') {
printf("%d\n", num1+num3);
}
else if (str1 == '-') {
printf("%d\n", num1-num3)... | main.c: In function 'main':
main.c:9:9: error: implicit declaration of function 'fgets' [-Wimplicit-function-declaration]
9 | fgets(str,10,stdin);
| ^~~~~
main.c:9:22: error: 'stdin' undeclared (first use in this function)
9 | fgets(str,10,stdin);
| ^~~~~... |
s248813635 | p03844 | C | int main(void)
{
int num1;
char str[10];
char str1[10];
char str2[10];
int num3;
fgets(str,10,stdin);
sscanf(str,"%d", &num1);
fgets(str,10,stdin);
fgets(str2, 10, stdin);
sscanf(str2,"%d", &num3);
if (str1 == '+') {
printf("%d\n", num1+num3);
}
else if (str1 == '-') {
printf("%d\n", num1-num3);
}... | main.c: In function 'main':
main.c:9:9: error: implicit declaration of function 'fgets' [-Wimplicit-function-declaration]
9 | fgets(str,10,stdin);
| ^~~~~
main.c:9:22: error: 'stdin' undeclared (first use in this function)
9 | fgets(str,10,stdin);
| ^~~~~... |
s156053218 | p03844 | C | #include <stdio.h>
int main(void)
{
int num;
char num2;
int num3;
scanf("%d",&num);
scanf("%c",&num2);
scanf("%d",&num3);
if(num2 == '+'){
printf("%d\n",num1 + num3);
}
else if(num2 == '-'){
printf("%d\n",num1 - num3);
}
return 0;
}
#include <stdio.h>
int main(void)
{
int nu... | main.c: In function 'main':
main.c:14:19: error: 'num1' undeclared (first use in this function); did you mean 'num3'?
14 | printf("%d\n",num1 + num3);
| ^~~~
| num3
main.c:14:19: note: each undeclared identifier is reported only once for each function it appears in... |
s778442769 | p03844 | C | #include <stdio.h>
int main(void)
{
int num;
char num2;
int num3;
scanf("%d",&num);
scanf("%c",&num2);
scanf("%d",&num3);
if(num2 == '+'){
printf("%d\n",num1 + num3);
}
else if(num2 == '-'){
printf("%d\n",num1 - num3);
}
return 0;
} | main.c: In function 'main':
main.c:14:19: error: 'num1' undeclared (first use in this function); did you mean 'num3'?
14 | printf("%d\n",num1 + num3);
| ^~~~
| num3
main.c:14:19: note: each undeclared identifier is reported only once for each function it appears in... |
s122424914 | p03844 | C | int main(void)
{
int num;
char num2;
int num3;
scanf("%d",&num);
scanf("%c",&num2);
scanf("%d",&num3);
if(num2 == '+'){
printf("%d",num1 + num3);
}
else{
printf("%d",num1 - num3);
}
return 0;
} | main.c: In function 'main':
main.c:7:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
7 | scanf("%d",&num);
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | int main(void)
main.c:7:3: warning: incompati... |
s025897851 | p03844 | C | #include <stdio.h>
int main(void)
{
int num;
char num2;
int num3;
scanf("%d",&num);
scanf("%c",&num2);
scanf("%d",&num3);
if(num2 == '+'){
printf("%d\n",num1 + num3);
}
else{
printf("%d\n",num1 - num3);
}
return 0;
} | main.c: In function 'main':
main.c:14:19: error: 'num1' undeclared (first use in this function); did you mean 'num3'?
14 | printf("%d\n",num1 + num3);
| ^~~~
| num3
main.c:14:19: note: each undeclared identifier is reported only once for each function it appears in... |
s167802163 | p03844 | C | #include <stdio.h>
int main(void)
{
int num;
char num2;
int num3;
scanf("%d",&num);
scanf("%c",&num2);
scanf("%d",&num3);
if(num2 == '+'){
printf("%d\n",num1 + num3);
}
else if(num2 == '-'){
printf("%d\n",num1 - num3);
}
else {
puts("");
}
return 0;
} | main.c: In function 'main':
main.c:14:19: error: 'num1' undeclared (first use in this function); did you mean 'num3'?
14 | printf("%d\n",num1 + num3);
| ^~~~
| num3
main.c:14:19: note: each undeclared identifier is reported only once for each function it appears in... |
s624012200 | p03844 | C | #include <stdio.h>
int main(void)
{
int num;
char num2;
int num3;
scanf("%d",&num);
scanf("%c",&num2);
scanf("%d",&num3);
if(num2 == '+'){
printf("%d\n",num1 + num3);
}
else if(num2 == '-'){
printf("%d\n",num1 - num3);
}
return 0;
} | main.c: In function 'main':
main.c:14:19: error: 'num1' undeclared (first use in this function); did you mean 'num3'?
14 | printf("%d\n",num1 + num3);
| ^~~~
| num3
main.c:14:19: note: each undeclared identifier is reported only once for each function it appears in... |
s392543848 | p03844 | C | int main(void)
{
int num;
char num2;
int num3;
scanf("%d",&num);
scanf("%c",&num2);
scanf("%d",&num3);
if(num2 == '+'){
printf("%d\n",num1 + num3);
}
else if(num2 == '-'){
printf("%d\n",num1 - num3);
}
return 0;
} | main.c: In function 'main':
main.c:7:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
7 | scanf("%d",&num);
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | int main(void)
main.c:7:3: warning: incompati... |
s324344697 | p03844 | C | #include<stdio.h>
int main(void)
{
int num;
char num2;
int num3;
scanf("%d",&num);
scanf("%c",&num2);
scanf("%d",&num3);
if(num2 == '+'){
printf("%d\n",num1 + num3);
}
else if(num2 == '-'){
printf("%d\n",num1 + num3);
}
return 0;
}
#include<stdio.h>
int main(void)
{
int num;... | main.c: In function 'main':
main.c:14:19: error: 'num1' undeclared (first use in this function); did you mean 'num3'?
14 | printf("%d\n",num1 + num3);
| ^~~~
| num3
main.c:14:19: note: each undeclared identifier is reported only once for each function it appears in... |
s795551223 | p03844 | C | #include <stdio.h>
int main(void)
{
int num;
char num2;
int num3;
scanf("%d",&num);
scanf("%c",&num2);
scanf("%d",&num3);
if(num2 == '+'){
printf("%d\n",num1 + num3);
}
else if(num2 == '-'){
printf("%d\n",num1 + num3);
}
return 0;
}
| main.c: In function 'main':
main.c:14:19: error: 'num1' undeclared (first use in this function); did you mean 'num3'?
14 | printf("%d\n",num1 + num3);
| ^~~~
| num3
main.c:14:19: note: each undeclared identifier is reported only once for each function it appears in... |
s959480080 | p03844 | C | #include<stdio.h>
int main(void)
{
int num;
char num2;
int num3;
scanf("%d",&num);
scanf("%c",&num2);
scanf("%d",&num3);
if(num2 == '+'){
printf("%d\n",num1 + num3);
}
else if(num2 == '-'){
printf("%d\n",num1 + num3);
}
return 0;
}
#include<stdio.h>
int main(void)
{
int num;... | main.c: In function 'main':
main.c:14:19: error: 'num1' undeclared (first use in this function); did you mean 'num3'?
14 | printf("%d\n",num1 + num3);
| ^~~~
| num3
main.c:14:19: note: each undeclared identifier is reported only once for each function it appears in... |
s909783867 | p03844 | C | #include<stdio.h>
int main(void)
{
int num;
char num2;
int num3;
scanf("%d",&num);
scanf("%c",&num2);
scanf("%d",&num3);
if(num2 == '+'){
printf("%d\n",num1 + num3);
}
else if(num2 == '-'){
printf("%d\n",num1 + num3);
}
return 0;
} | main.c: In function 'main':
main.c:14:19: error: 'num1' undeclared (first use in this function); did you mean 'num3'?
14 | printf("%d\n",num1 + num3);
| ^~~~
| num3
main.c:14:19: note: each undeclared identifier is reported only once for each function it appears in... |
s015610186 | p03844 | C | #include<stdio.h>
int main(void)
{
int num;
char num2;
int num3;
scanf("%d",&num);
scanf("%c",&num2);
scanf("%d",&num3);
if(num2 == '+'){
printf("%d\n",num1 + num3);
}
if(num2 == '-'){
printf("%d\n",num1 + num3);
}
return 0;
} | main.c: In function 'main':
main.c:14:19: error: 'num1' undeclared (first use in this function); did you mean 'num3'?
14 | printf("%d\n",num1 + num3);
| ^~~~
| num3
main.c:14:19: note: each undeclared identifier is reported only once for each function it appears in... |
s535437002 | p03844 | C | #include<stdio.h>
int main(void)
{
int num;
char num2;
int num3;
int num4;
scanf("%d",&num);
scanf("%c",&num2);
scanf("%d",&num3);
if(num2 == '+'){
printf("%d\n",num1 + num3 = num4);
}
if(num2 == '-'){
printf("%d\n",num1 + num3 = num4);
}
return 0;
} | main.c: In function 'main':
main.c:15:19: error: 'num1' undeclared (first use in this function); did you mean 'num4'?
15 | printf("%d\n",num1 + num3 = num4);
| ^~~~
| num4
main.c:15:19: note: each undeclared identifier is reported only once for each function it app... |
s535804256 | p03844 | C | #include<stdio.h>
int main(void)
{
int num;
char num2[10];
int num3;
int num4;
scanf("%d",&num);
scanf("%c",&num2);
scanf("%d",&num3);
if(num2 == '+'){
printf("%d\n",num1 + num3 = num4);
}
if(num2 == '-'){
printf("%d\n",num1 + num3 = num4);
return 0;
} | main.c: In function 'main':
main.c:14:11: warning: comparison between pointer and integer
14 | if(num2 == '+'){
| ^~
main.c:15:19: error: 'num1' undeclared (first use in this function); did you mean 'num4'?
15 | printf("%d\n",num1 + num3 = num4);
| ^~~~
| ... |
s556396159 | p03844 | C | #include<stdio.h>
int main(void)
{
int num;
char num2[10];
int num3;
int num4;
scanf("%d",&num);
scanf("%c",&num2);
scanf("%d",&num3);
if(num2 == '+'){
printf("%d + %d = %d\n",num1,num3,num4);
}
if(num2 == '-'){
printf("%d - %d = %d\n",num1,num3,num4);
return 0;
} | main.c: In function 'main':
main.c:14:11: warning: comparison between pointer and integer
14 | if(num2 == '+'){
| ^~
main.c:15:29: error: 'num1' undeclared (first use in this function); did you mean 'num4'?
15 | printf("%d + %d = %d\n",num1,num3,num4);
| ^~~... |
s566828474 | p03844 | C | #include<stdio.h>
int main(void)
{
int num;
char num2[10];
int num3;
int num4;
scanf("%d",&num);
fgets(num2,10,stdin);
scanf("%d",&num3);
if(num2 == '+'){
printf("%d + %d = %d\n",num1,num3,num4);
}
if(num2 == '-'){
printf("%d - %d = %d\n",num1,num3,num4);
return 0;
} | main.c: In function 'main':
main.c:14:11: warning: comparison between pointer and integer
14 | if(num2 == '+'){
| ^~
main.c:15:29: error: 'num1' undeclared (first use in this function); did you mean 'num4'?
15 | printf("%d + %d = %d\n",num1,num3,num4);
| ^~~... |
s701281075 | p03844 | C | #include<stdio.h>
int main(void)
{
int num;
char num2[10];
int num3;
int num4;
scanf("%d",&num);
fgets(num2,10,stdin);
scanf("%d",&num3);
if(num2 == "+"){
printf("%d + %d = %d\n",num1,num3,num4);
}
if(num2 == "-"){
printf("%d - %d = %d\n",num1,num3,num4);
return 0;
} | main.c: In function 'main':
main.c:15:29: error: 'num1' undeclared (first use in this function); did you mean 'num4'?
15 | printf("%d + %d = %d\n",num1,num3,num4);
| ^~~~
| num4
main.c:15:29: note: each undeclared identifier is reported only onc... |
s974686791 | p03844 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string a;
int c,b;
cin>>b>>a>>c;
if(a=='-') cout<<b-c;
else cout<<b+c;
cout<<"\n";
} | a.cc: In function 'int main()':
a.cc:7:9: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
7 | if(a=='-') cout<<b-c;
| ~^~~~~
| | |
| | char
| std::string {aka std::__cxx11::basic_string<c... |
s146961003 | p03844 | C++ | using namespace std;
int main(){
string a;
int c,b;
cin>>b>>a>>c;
if(a=='-') cout<<b-c;
else cout<<b+c;
cout<<"\n";
} | a.cc: In function 'int main()':
a.cc:3:1: error: 'string' was not declared in this scope
3 | string a;
| ^~~~~~
a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
+++ |+#include <string>
1 | using namespace std;
a.cc:5:1: error: 'cin' wa... |
s218537173 | p03844 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string a;
itn c,b
cin>>b>>a>>c;
if(a=='-') cout<<b-c;
else cout<<b+c;
cout<<"\n";
}
| a.cc: In function 'int main()':
a.cc:5:3: error: 'itn' was not declared in this scope; did you mean 'int'?
5 | itn c,b
| ^~~
| int
a.cc:7:7: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
7 | if(a=='-') cout<<b-c;
... |
s263881515 | p03844 | C | a = input()
left, op, right = a.split(" ")
if op == '-':
print(int(left) - int(right))
else:
print(int(left) + int(right)) | main.c:1:1: warning: data definition has no type or storage class
1 | a = input()
| ^
main.c:1:1: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int]
main.c:1:5: error: implicit declaration of function 'input' [-Wimplicit-function-declaration]
1 | a = input()
| ^~~~~
main.c:1:5:... |
s378820359 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int A,B;
char S;
cin >> A >> S >> B;
// ここにプログラムを追記
if ( S == '+') {
cout << A+B << endl;
}else if ( S == '-') {
cout << A-B << endl;
}else {
cout << error << endl;
}
}
| a.cc: In function 'int main()':
a.cc:15:9: error: 'error' was not declared in this scope; did you mean 'perror'?
15 | cout << error << endl;
| ^~~~~
| perror
|
s468727131 | p03844 | C | #include <iostream>
using namespace std;
int const MAX = 11;
typedef int DataType;
void Error(const string& s)
{
cout << s;
}
struct Stack
{
DataType data[MAX];
int top;
int length;
};
Stack a;
Stack b;
Stack r;
char op;
void InitStack(Stack *s)
{
s->top = -1;
}
bool StackEmpty(Stack *s)
{
... | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s655115644 | p03844 | C | #include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#define ll long long
#define rep(i,l,r) for(ll i=(l);i<(r);i++)
#define max(p,q) ((p)>(q)?(p):(q))
#define min(p,q) ((p)<(q)?(p):(q))
#define chmax(a,b) ((a)=(a)>(b)?(a):(b))
#define chmin(a,b) ((a)=(a)<(b)?(a):(b))
#define abs(p) ((p)>=(0)?(p... | main.c: In function 'main':
main.c:18:27: error: expected expression before ')' token
18 | scanf("%lld %c %lld", );
| ^
|
s310881029 | p03844 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int a,c
string op;
cin>>a>>op>>c;
if(op=="+"){
cout<<a+c<<endl;
}else{
cout<<a-c<<endl;
}
}
| a.cc: In function 'int main()':
a.cc:5:5: error: expected initializer before 'string'
5 | string op;
| ^~~~~~
a.cc:6:13: error: 'op' was not declared in this scope
6 | cin>>a>>op>>c;
| ^~
a.cc:6:17: error: 'c' was not declared in this scope
6 | cin>>a>>op>>c;
| ... |
s041771810 | 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: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... |
s073857377 | p03844 | C++ | #include <bts/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:1:10: fatal error: bts/stdc++.h: No such file or directory
1 | #include <bts/stdc++.h>
| ^~~~~~~~~~~~~~
compilation terminated.
|
s912006477 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int a, b;
string s;
cin >> a >> s >> b;
if(s == '+'){
cout << a + b <<endl;
}
else if(s == '-'){
cout << a - b <<endl;
}
}
| a.cc: In function 'int main()':
a.cc:8:8: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
8 | if(s == '+'){
| ~ ^~ ~~~
| | |
| | char
| std::string {aka std::__cxx11::basic_string<char>}
In fil... |
s165832003 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main()
{
int A, B;
string op;
cin >> A >> op >> C;
if (op == "+") cout << A + B << endl;
else cout << A - B << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:8:23: error: 'C' was not declared in this scope
8 | cin >> A >> op >> C;
| ^
|
s999405178 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int A, B
string S;
cin >> A >> S >> B;
if (S == "+"){
cout << A+B<<endl;
}
else {
cout << A-B << endl;
}
} | a.cc: In function 'int main()':
a.cc:6:3: error: expected initializer before 'string'
6 | string S;
| ^~~~~~
a.cc:7:15: error: 'S' was not declared in this scope
7 | cin >> A >> S >> B;
| ^
a.cc:7:20: error: 'B' was not declared in this scope
7 | cin >> A >> S >> B;
|... |
s313889386 | 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(op.equals("-"))System.out.println(a-b);
else System.out.println(a+b);
}
} | Main.java:7: error: incompatible types: String cannot be converted to int
int b = sc.next();
^
1 error
|
s815580206 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int a,b;
string op;
cin >>a>>op>>b;
if(op=='+'){
cout << a+b <<endl;
}
else{
cout << a-b<<endl;
}
} | a.cc: In function 'int main()':
a.cc:8:8: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
8 | if(op=='+'){
| ~~^~~~~
| | |
| | char
| std::string {aka std::__cxx11::basic_string<char>}
In file in... |
s286128492 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int a,b;
string op;
cin >>a>>op>>c;
if(op=='+'){
cout << a+b <<endl;
}
else{
cout << a-b<<endl;
}
}
| a.cc: In function 'int main()':
a.cc:7:16: error: 'c' was not declared in this scope
7 | cin >>a>>op>>c;
| ^
a.cc:8:8: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
8 | if(op=='+'){
| ~~^~~~~
| ... |
s903086118 | p03844 | C++ | / A - Addition and Subtraction Easy
#include <bits/stdc++.h>
using namespace std;
int main(){
int a,b; char o; cin>>a>>o>>b;
cout<< (o=='+'? a+b: a-b) <<endl;
} | a.cc:1:1: error: expected unqualified-id before '/' token
1 | / A - Addition and Subtraction Easy
| ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:62,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
... |
s395113957 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main()
{
int A, B, ans;
char C;
cin >> A >> C >> B;
if (C == '+')
{
ans = A + B
}
else
{
ans = A - B
}
cout << ans << endl;
}
| a.cc: In function 'int main()':
a.cc:11:16: error: expected ';' before '}' token
11 | ans = A + B
| ^
| ;
12 | }
| ~
a.cc:15:16: error: expected ';' before '}' token
15 | ans = A - B
| ^
| ;
16... |
s108036972 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int a,b;
string op;
cin >> a >> op >> b;
if(op=='+'){
cout << a+b << endl;
}else{
cout << a-b << endl;
}
} | a.cc: In function 'int main()':
a.cc:8:8: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
8 | if(op=='+'){
| ~~^~~~~
| | |
| | char
| std::string {aka std::__cxx11::basic_string<char>}
In file in... |
s189097960 | p03844 | C++ | #include <iostream>
using namespace std;
int main() {
int a, b;
string s;
cin >> a >> s >> b;
if(s == '+'){
cout << a + b << endl;
}
if(s == '-'){
cout << a - b << endl;
}
} | a.cc: In function 'int main()':
a.cc:8:14: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
8 | if(s == '+'){
| ~ ^~ ~~~
| | |
| | char
| std::string {aka std::__cx... |
s775580500 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int A,B,ans;
char op;
cin >> A >> op >> Bl;
if(op == '+') {
ans = A + B;
}
else if(op == '-') {
ans = A - B;
}
cout << ans << endl;
}
| a.cc: In function 'int main()':
a.cc:7:21: error: 'Bl' was not declared in this scope; did you mean 'B'?
7 | cin >> A >> op >> Bl;
| ^~
| B
|
s898969733 | p03844 | C++ | import java.util.*
fun main() {
val scanner = Scanner(System.`in`)
val n = scanner.nextInt()
val list = mutableListOf<Int>()
for (i in 0..n) {
val a = scanner.nextInt()
list.add(i, a)
}
val m = scanner.nextInt()
for (i in 0 until m){
val drink = scanner.nextInt()
... | a.cc:4:34: error: stray '`' in program
4 | val scanner = Scanner(System.`in`)
| ^
a.cc:4:37: error: stray '`' in program
4 | val scanner = Scanner(System.`in`)
| ^
a.cc:7:15: error: too many decimal points in number
7 |... |
s713225601 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int A, B, ans;
string 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:8:15: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
8 | if(op == '+') ans = A + B;
| ~~ ^~ ~~~
| | |
| | char
| std::strin... |
s244515193 | 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:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
8 | if (op == "+") {
| ~~~^~~~~~
|
s965453589 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int a, b;
char op;
cin >> a >> op >> c;
if (op == "+") {
cout << a + b << endl;
}
else {
cout << a - b << endl;
}
}
| a.cc: In function 'int main()':
a.cc:7:21: error: 'c' was not declared in this scope
7 | cin >> a >> op >> c;
| ^
a.cc:8:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
8 | if (op == "+") {
| ~~~^~~~~~
|
s320623328 | p03844 | Java | import lesson.topcoder.FriendsScore;
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
String op = sc.next();
int b = sc.nextInt();
int ans = 0;
if (op.equals("+")) {
... | Main.java:1: error: package lesson.topcoder does not exist
import lesson.topcoder.FriendsScore;
^
1 error
|
s853885886 | 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 if(c=='-') cout<<a-b<<endl;
else if(c=='*') cout<<a*b<<endl;
else if(c=='/'){
if(b==0) cout<<"Divided by zero!"<<endl;
else cout<<a/b<<endl;
}
else cout<<"Invalid operator!"<<endl;
ret... | main.c:1:9: fatal error: bits/stdc++.h: No such file or directory
1 | #include<bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s548631216 | p03844 | C++ | #include <iostream>
#include <string>
using namespace std;
class Cal {
public:
Cal(int num1, int num2, int num3) {
CaNum1 = num1;
CaM = num2;
CaNum2 = num3;
}
void Result();
private:
int add() { return CaNum1 + CaNum2; };
int sub() { return CaNum1 - CaNum2; };
int CaNum1, CaNum2, CaM;
};
void Cal::Result... | a.cc: In function 'int main()':
a.cc:76:9: error: 'strcpy' was not declared in this scope
76 | strcpy(str, s.c_str());
| ^~~~~~
a.cc:2:1: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include <iostream>
+++ |+#include <cstrin... |
s363392830 | p03844 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
long x,y,z,a;
cin >> x >> y >> z;
if (y == "+") {
a = x+z;
cout << a << endl;
} else if (y == "-") {
a = x-z;
cout << a << endl;
}
} | a.cc: In function 'int main()':
a.cc:6:9: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
6 | if (y == "+") {
| ~~^~~~~~
a.cc:9:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
9 | } else if (y == "-") {
| ~~^~~~~~
|
s985392452 | 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 ';' before 'A'
7 | cin A >> op >> B;
| ^~
| ;
|
s655289061 | p03844 | C++ | #include<bits/std c++.h>
using namespace std.
long long a,b;
char s;
int main(){
scanf("%lld %c %lld",&a,&s,&b);
if(s=='+'){
printf("%lld\n",a+b);}
else{
printf("%lld\n" ,a-b);}
return 0;} | a.cc:1:9: fatal error: bits/std c++.h: No such file or directory
1 | #include<bits/std c++.h>
| ^~~~~~~~~~~~~~~~
compilation terminated.
|
s909273721 | p03844 | C++ | include<bits/stdc++.h>
using namespace std;
long long a,b;
char s;
int main()
{
scanf("%lld %c %lld",&a,&s,&b);
if(s=='+')
{
printf("%lld\n",a+b);
}
else
{
printf("%lld\n",a-b);
}
return 0;
} | a.cc:1:1: error: 'include' does not name a type
1 | include<bits/stdc++.h>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:7:5: error: 'scanf' was not declared in this scope
7 | scanf("%lld %c %lld",&a,&s,&b);
| ^~~~~
a.cc:10:9: error: 'printf' was not declared in this scope
10 | p... |
s011572575 | p03844 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
char 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:6:3: error: expected initializer before 'cin'
6 | cin>>a>>op>>b;
| ^~~
a.cc:8:13: error: 'b' was not declared in this scope
8 | cout << a+b <<endl;
| ^
a.cc:9:18: error: 'b' was not declared in this scope
9 | else cout << a-b <<endl;
... |
s368589684 | p03844 | C++ | #include <iostream>
using namespace std;
int main(){
int a,b;
char c ='z';
cin>>a,c,b;
if('z'=='+'){
cout<<a+b;
else
cout<<a-b;
}
}
| a.cc: In function 'int main()':
a.cc:9:1: error: expected '}' before 'else'
9 | else
| ^~~~
a.cc:7:13: note: to match this '{'
7 | if('z'=='+'){
| ^
a.cc: At global scope:
a.cc:12:1: error: expected declaration before '}' token
12 | }
| ^
|
s778349338 | p03844 | C++ | #include <iostream>
using namespace std;
int main(){
int a,b;
char c ='z';
cin>>a,b,c;
if('z'=='+'){
cout<<a+b;
else
cout<<a-b;
}
} | a.cc: In function 'int main()':
a.cc:9:1: error: expected '}' before 'else'
9 | else
| ^~~~
a.cc:7:13: note: to match this '{'
7 | if('z'=='+'){
| ^
a.cc: At global scope:
a.cc:12:1: error: expected declaration before '}' token
12 | }
| ^
|
s459495443 | p03844 | C++ | #include <iostream>
using namespace std;
int main(){
int a,b;
char c ='z';
cin>>a,b,c;
if(c=='+')
cout<<a+b
else
cout<<a-b;
} | a.cc: In function 'int main()':
a.cc:8:10: error: expected ';' before 'else'
8 | cout<<a+b
| ^
| ;
9 | else
| ~~~~
|
s003528327 | p03844 | C++ | #include <iostream>
using namespace std;
int main(){
int a,b;
char ;
cin>>a,b,c;
if(c=='+'){
cout<<a+b
else
cout<<a-b;
}
} | a.cc: In function 'int main()':
a.cc:5:1: error: declaration does not declare anything [-fpermissive]
5 | char ;
| ^~~~
a.cc:6:10: error: 'c' was not declared in this scope
6 | cin>>a,b,c;
| ^
a.cc:8:10: error: expected ';' before 'else'
8 | cout<<a+b
| ^
| ... |
s339557560 | p03844 | C++ | #include <iostream>
using namespace std;
int main(){
int a,b;
char c ='';
cin>>a,b,c;
if(c=='+'){
cout<<a+b
else
cout<<a-b;
}
} | a.cc:5:9: error: empty character constant
5 | char c ='';
| ^~
a.cc: In function 'int main()':
a.cc:8:10: error: expected ';' before 'else'
8 | cout<<a+b
| ^
| ;
9 | else
| ~~~~
|
s960672793 | p03844 | C++ | #include <iostream>
using namespace std;
int main(){
int a,b;
char c ;
cin>>a,b,c;
switch (c):{
case '+':
cout<<a+b;
break;
case '-':
cout<<a-b;
break;
default;
}
} | a.cc: In function 'int main()':
a.cc:7:11: error: expected primary-expression before ':' token
7 | switch (c):{
| ^
|
s354925745 | p03844 | C++ | #include <iostream>
using namespace std;
int main(){
int a,b;
char c ='';
cin>>a,b,c;
switch (c):{
case '+':
cout<<a+b;
break;
case '-':
cout<<a-b;
break;
default;
}
}
| a.cc:5:9: error: empty character constant
5 | char c ='';
| ^~
a.cc: In function 'int main()':
a.cc:7:11: error: expected primary-expression before ':' token
7 | switch (c):{
| ^
|
s048627220 | p03844 | C++ | #include<bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
using Graph =vector<int>;
typedef pair<ll,int> P;
const ll MAX_N=131072;
int bit[MAX_N*2-1];
ll n;
int main(){
string s;
ll A,B;
cin >>A>>s>>B;
if(s=='+') cout <<A+B<<endl;
else cout <<A-B<<endl;
... | a.cc: In function 'int main()':
a.cc:16:7: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
16 | if(s=='+') cout <<A+B<<endl;
| ~^~~~~
| | |
| | char
| std::string {aka std::__cxx11::basic_string<cha... |
s547708888 | p03844 | C++ | #include<bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
using Graph =vector<int>;
typedef pair<ll,int> P;
const ll MAX_N=131072;
int bit[MAX_N*2-1];
ll n;
int main(){
string s;
ll A,B;
cin >>A>>s>>B;
if(s=='+') cout <<A+B<<endl;
else cout <<A-B<<endl;
... | a.cc: In function 'int main()':
a.cc:16:7: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
16 | if(s=='+') cout <<A+B<<endl;
| ~^~~~~
| | |
| | char
| std::string {aka std::__cxx11::basic_string<cha... |
s208481246 | p03844 | C++ | #include <iostream>
using namespace std;
int main()
{
long long a,b;
char o;
cin>>a>>o>>b;
if(1<=a && b<=10^9){
if(o=='+'){
z=a+b;
printf("%d",z);}
else{
if(o=='-')
z=a-b;
printf("%d",z);}
}
//return 0;
} | a.cc: In function 'int main()':
a.cc:10:17: error: 'z' was not declared in this scope
10 | z=a+b;
| ^
a.cc:14:17: error: 'z' was not declared in this scope
14 | z=a-b;
| ^
a.cc:15:29: error: 'z' was not declared in this scope
15 | ... |
s989109149 | p03844 | C++ | #include <iostream>
using namespace std;
int main()
{
long long a,b;
char o;
cin>>a>>o>>b;
if(1<=a && b<=10^9){
if(o=='+')
z=a+b;
printf("%d",z);
else
if(o=='-')
z=a-b;
printf("%d",z);
}
return 0;
} | a.cc: In function 'int main()':
a.cc:10:17: error: 'z' was not declared in this scope
10 | z=a+b;
| ^
a.cc:11:29: error: 'z' was not declared in this scope
11 | printf("%d",z);
| ^
a.cc:12:17: error: expected '}' before 'else'... |
s753109541 | 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;
else
cout<<a-b;
return 0;
} | a.cc: In function 'int main()':
a.cc:14:9: error: expected '}' before 'else'
14 | else
| ^~~~
a.cc:10:19: note: to match this '{'
10 | if(op='+'){
| ^
|
s084937392 | p03844 | Java | public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
String op = sc.next();
int b = sc.nextInt();
if (op.equals("+")) {
System.out.println(a + b);
} else {
System.out.println(a - b);
}
}
} | Main.java:3: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:3: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
2 errors
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.