submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s926721249
p04029
C++
#include<stdio.h> int main() { int n; int ans; scanf("%d", &n); ans = (n*(n+1))/2; printf("%d\n", ans); return; }
a.cc: In function 'int main()': a.cc:10:9: error: return-statement with no value, in function returning 'int' [-fpermissive] 10 | return; | ^~~~~~
s303205068
p04029
Java
public class Main { static Scanner sc = new Scanner(System.in); public static void main(String[] args) { int n = sc.nextInt(); int ans = 0; for (int i = 1; i <= n; i++) { ans += i; } System.out.println(ans); } }
Main.java:5: error: cannot find symbol static Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:5: error: cannot find symbol static Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s533329628
p04029
C++
n = int(input()) print(sum([i for i in range(1, n+1)]))
a.cc:1:1: error: 'n' does not name a type 1 | n = int(input()) | ^
s801919247
p04029
C++
#include <bits/stdc++.h> using namespace std; int main() { int x; cin >> x; cout << x(x+1)/2 << endl; }
a.cc: In function 'int main()': a.cc:7:12: error: 'x' cannot be used as a function 7 | cout << x(x+1)/2 << endl; | ~^~~~~
s722254733
p04029
C++
#include <bits/stdc++.h> using namespace std; int main() { int x; cin >> x; cout << n*(n+1)/2 << endl; }
a.cc: In function 'int main()': a.cc:7:11: error: 'n' was not declared in this scope 7 | cout << n*(n+1)/2 << endl; | ^
s313780689
p04029
C
#include <iostream> using namespace std; int main(){ int N; cin >> N; char S[N]; cin >> S; int ans; for(int i = 0; i<=N; N++){ ans = ans + i; } cout << ans << endl; }
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s839098701
p04029
Java
import java.util.*; public class Main { public static void main(String[] args) { Scanner yomi = new Scanner(System.in); int n = yomi.nextInt(); int n2=0; for (int i=1;i<=n;i+){ n2=n2+i; } System.out.println(n2); } }
Main.java:8: error: illegal start of expression for (int i=1;i<=n;i+){ ^ Main.java:8: error: not a statement for (int i=1;i<=n;i+){ ^ 2 errors
s121077554
p04029
C++
#include<iostream> using namespace std; int main{ int N; cin >> N; cout << N * (N+1) /2 << endl; return 0; }
a.cc:4:5: error: cannot declare '::main' to be a global variable 4 | int main{ | ^~~~ a.cc:5:3: error: expected primary-expression before 'int' 5 | int N; | ^~~ a.cc:5:3: error: expected '}' before 'int' a.cc:4:9: note: to match this '{' 4 | int main{ | ^ a.cc:6:3: error: 'cin' does not name a type 6 | cin >> N; | ^~~ a.cc:7:3: error: 'cout' does not name a type 7 | cout << N * (N+1) /2 << endl; | ^~~~ a.cc:8:3: error: expected unqualified-id before 'return' 8 | return 0; | ^~~~~~ a.cc:9:1: error: expected declaration before '}' token 9 | } | ^
s789153694
p04029
C++
#include<iostream> using namespace std; int main{ int N; cout << N * (N+1) /2 << endl; return 0; }
a.cc:4:5: error: cannot declare '::main' to be a global variable 4 | int main{ | ^~~~ a.cc:5:3: error: expected primary-expression before 'int' 5 | int N; | ^~~ a.cc:5:3: error: expected '}' before 'int' a.cc:4:9: note: to match this '{' 4 | int main{ | ^ a.cc:6:3: error: 'cout' does not name a type 6 | cout << N * (N+1) /2 << endl; | ^~~~ a.cc:7:3: error: expected unqualified-id before 'return' 7 | return 0; | ^~~~~~ a.cc:8:1: error: expected declaration before '}' token 8 | } | ^
s170287263
p04029
C
#include <stdio.h> int main(void) { scanf("",&ninzuu); int candy; candy = 0; if(n=1;n>ninzuu;n++;) candy += n;
main.c: In function 'main': main.c:5:13: error: 'ninzuu' undeclared (first use in this function) 5 | scanf("",&ninzuu); | ^~~~~~ main.c:5:13: note: each undeclared identifier is reported only once for each function it appears in main.c:8:6: error: 'n' undeclared (first use in this function) 8 | if(n=1;n>ninzuu;n++;) | ^ main.c:8:9: error: expected ')' before ';' token 8 | if(n=1;n>ninzuu;n++;) | ~ ^ | ) main.c:9:5: error: expected declaration or statement at end of input 9 | candy += n; | ^~~~~
s958156902
p04029
C
#include<stdio.h> main() { int a,b,sum=0; printf("Input a:"); scanf("%d",&a); for(b=0;b<=a;b++){ sum=sum+b } printf("%d",sum); }
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int] 2 | main() | ^~~~ main.c: In function 'main': main.c:8:22: error: expected ';' before '}' token 8 | sum=sum+b | ^ | ; 9 | } | ~
s390930513
p04029
C
#include<stdio.h> int main(){ int sum=0,i,n; sucanf("%d",&n); for(i=1;i<=n;i++)sum+=i; printf("%d\n",sum); }
main.c: In function 'main': main.c:4:1: error: implicit declaration of function 'sucanf'; did you mean 'sscanf'? [-Wimplicit-function-declaration] 4 | sucanf("%d",&n); | ^~~~~~ | sscanf
s397891461
p04029
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n, ans; cin >> n; for(i=0;i<n;i++) ans += i+1; cout << ans << endl; }
a.cc: In function 'int main()': a.cc:6:7: error: 'i' was not declared in this scope 6 | for(i=0;i<n;i++) ans += i+1; | ^
s138189185
p04029
C++
#include <bits/stdc++.h> using namespace std; int main(){ string s; string output(10,''); int point; cin >> s; point = 0; for(int i=0;i<s.size();i++){ if(s.at(i)=='B'){ //output.at(point) = ''; point = max(point-1,0); }else{output.at(point) = s.at(i); point++; } } cout << output.substr(0,point) << endl; return 0; }
a.cc:6:20: error: empty character constant 6 | string output(10,''); | ^~
s100519666
p04029
C++
#include<bits/stdc++.h> using namespace std; int main() { int n,s ; cin >> n ; s=n*(n+1)/2 cout << s << endl; }
a.cc: In function 'int main()': a.cc:8:14: error: expected ';' before 'cout' 8 | s=n*(n+1)/2 | ^ | ; 9 | 10 | cout << s << endl; | ~~~~
s029701946
p04029
C++
#include<bits/stdc++.h> using namespace std; int main() { int N; cin >> N; cout << N(N+1)/2 << endl; }
a.cc: In function 'int main()': a.cc:8:12: error: 'N' cannot be used as a function 8 | cout << N(N+1)/2 << endl; | ~^~~~~
s097384896
p04029
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n,sum=0; cin >> m; for(int i=1;i<=n;i++){ sum+=i; } cout << sum; return 0; }
a.cc: In function 'int main()': a.cc:7:16: error: 'm' was not declared in this scope 7 | cin >> m; | ^
s168400211
p04029
C++
#include<bits/stdc++.h> using namespace std; #define int long long #define pb emplace_back #define mp make_pair #define f(i,a,n) for(int i=a ; i<n ; i++) #define F first #define S second #define fast ios:: sync_with_stdio(false),cin.tie(0); int32_t main(){ fast; int n; cin >>> n; cout << (n+1)/2 + (n/2)*2; }
a.cc: In function 'int32_t main()': a.cc:15:15: error: expected primary-expression before '>' token 15 | cin >>> n; | ^
s126054849
p04029
C
#include<stdio.h> int main() { int N,sum=0,i; 1<=N<=100; scanf("%d",&N); sum=(n+1)*n/2; printf("%d\n",sum); printf("The sum of the integers from 1 to %d is %d.",N,sum); return 0; }
main.c: In function 'main': main.c:7:14: error: 'n' undeclared (first use in this function) 7 | sum=(n+1)*n/2; | ^ main.c:7:14: note: each undeclared identifier is reported only once for each function it appears in
s046020453
p04029
C
#include<stdio.h> int main() { int N,sum=0,i; 1<=N<=100; scanf("%d",&N); sum=(n+1)*n/2 printf("%d\n",sum); printf("The sum of the integers from 1 to %d is %d.",N,sum); return 0; }
main.c: In function 'main': main.c:7:14: error: 'n' undeclared (first use in this function) 7 | sum=(n+1)*n/2 | ^ main.c:7:14: note: each undeclared identifier is reported only once for each function it appears in main.c:7:22: error: expected ';' before 'printf' 7 | sum=(n+1)*n/2 | ^ | ; 8 | printf("%d\n",sum); | ~~~~~~
s560457843
p04029
C
#include<stdio.h> int main() { int N,sum=0,i; 1<=N<=100; scanf("%d",&N); if (i=1;i<=N;i++) { sum=sum+i; } printf("The sum of the integers from 1 to %d is %d.",N,sum); return 0; }
main.c: In function 'main': main.c:7:16: error: expected ')' before ';' token 7 | if (i=1;i<=N;i++) | ~ ^ | )
s639784869
p04029
C
#include<stdio.h> int main() { int N,sum=0,i; 1<=N<=100; scanf("%d",&N); if (i=1;i<=N;i++) sum=sum+i; printf("The sum of the integers from 1 to %d is %d",N,sum); return 0; }
main.c: In function 'main': main.c:7:16: error: expected ')' before ';' token 7 | if (i=1;i<=N;i++) | ~ ^ | )
s993175457
p04029
C
#include<stdio.h> int main() { int N,sum=0,i; 1<=N<=100; scanf("%d",&N); if (i=1;i>N;i++) sum=sum+i; printf("The sum of the integers from 1 to %d is %d",N,sum); return 0; }
main.c: In function 'main': main.c:7:16: error: expected ')' before ';' token 7 | if (i=1;i>N;i++) | ~ ^ | )
s061934994
p04029
C
#include<stdio.h> int main() { int N,sum=0,i; 1<=N<=100; scanf("%d",&N); if (i=1;i>N;i++) sum=sum+i printf("The sum of the integers from 1 to %d is %d",N,sum); return 0; }
main.c: In function 'main': main.c:7:16: error: expected ')' before ';' token 7 | if (i=1;i>N;i++) | ~ ^ | ) main.c:8:26: error: expected ';' before 'printf' 8 | sum=sum+i | ^ | ; 9 | printf("The sum of the integers from 1 to %d is %d",N,sum); | ~~~~~~
s063977298
p04029
C
#include<stdio.h> int main() { int N,sum; scanf("%d",&N); sum=(1+N)*N\2; printf("The sum of the integers from 1 to %d is %d",N,sum); return 0; }
main.c: In function 'main': main.c:6:20: error: stray '\' in program 6 | sum=(1+N)*N\2; | ^ main.c:6:20: error: expected ';' before numeric constant 6 | sum=(1+N)*N\2; | ^~ | ;
s310453115
p04029
C++
#include <iostream> using namespace std; int mian(){ int n;cin>>n; cout << n*(n+1)/2 << endl; #include <iostream> using namespace std; int main(){ int n;cin>>n; cout << n*(n+1)/2 << endl; }
a.cc: In function 'int mian()': a.cc:8:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 8 | int main(){ | ^~ a.cc:8:9: note: remove parentheses to default-initialize a variable 8 | int main(){ | ^~ | -- a.cc:8:9: note: or replace parentheses with braces to value-initialize a variable a.cc:8:11: error: a function-definition is not allowed here before '{' token 8 | int main(){ | ^ a.cc:11:2: error: expected '}' at end of input 11 | } | ^ a.cc:3:11: note: to match this '{' 3 | int mian(){ | ^ a.cc:11:2: warning: no return statement in function returning non-void [-Wreturn-type] 11 | } | ^
s531113976
p04029
C++
#include <iostream> using namespace std; int mian(){ int n;cin>>n; cout << n*(n+1)/2 << endl; }
a.cc: In function 'int mian()': a.cc:6:1: warning: no return statement in function returning non-void [-Wreturn-type] 6 | } | ^ /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s898512383
p04029
C++
#include<cstdio> #include<algorithm> #include<cmath> #include<iostream> #include<queue> #include<stack> #include<cstring> #include<string> using namespace std; typedef long long LL; int main(){ LL n,m; cin >> n; cout << (1 + n) * n / 2 << endl; return 0; }#include<cstdio> #include<algorithm> #include<cmath> #include<iostream> #include<queue> #include<stack> #include<cstring> #include<string> using namespace std; typedef long long LL; int main(){ LL n,m; cin >> n; cout << (1 + n) * n / 2 << endl; return 0; }
a.cc:16:10: error: stray '#' in program 16 | }#include<cstdio> | ^ a.cc:16:11: error: 'include' does not name a type 16 | }#include<cstdio> | ^~~~~~~ a.cc:26:5: error: redefinition of 'int main()' 26 | int main(){ | ^~~~ a.cc:11:5: note: 'int main()' previously defined here 11 | int main(){ | ^~~~
s935924678
p04029
C
#include<stdio.h> int main(void) { int a,b,i; scan("%d",&a); for(i=0;i<a;i++) b+=i; printf("%d",b); return 0; }
main.c: In function 'main': main.c:5:1: error: implicit declaration of function 'scan'; did you mean 'scanf'? [-Wimplicit-function-declaration] 5 | scan("%d",&a); | ^~~~ | scanf
s292073494
p04029
Java
import java.util.Scanner; public class A { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int N = Integer.parseInt(scanner.next()); scanner.close(); int result = 0; for (int i = 1; i <= N; i++) { result += i; } System.out.println(result); } }
Main.java:3: error: class A is public, should be declared in a file named A.java public class A { ^ 1 error
s912997056
p04029
C++
#include<stdio.h> main() { int sum,i,N; scanf("%d",&N); sum = 0; for(i = 1;i <= N;i++) { sum = sum + i; } printf("%d",sum) return 0; }
a.cc:2:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 2 | main() | ^~~~ a.cc: In function 'int main()': a.cc:11:25: error: expected ';' before 'return' 11 | printf("%d",sum) | ^ | ; 12 | return 0; | ~~~~~~
s779495257
p04029
C++
#include<iostream> #include<string> #include<algorithm> using namespace std; int main(){ int a,i; cin>>a; int ans=0; for(i=1;i<=a;i++) ans+=1; } cout<<ans; return 0; }
a.cc:13:1: error: 'cout' does not name a type 13 | cout<<ans; | ^~~~ a.cc:16:3: error: expected unqualified-id before 'return' 16 | return 0; | ^~~~~~ a.cc:17:1: error: expected declaration before '}' token 17 | } | ^
s411967622
p04029
Java
import java.util.*; class Main { public static void main(String[] args){ int total; Scanner sc = new Scanner(System.in); int N = sc.nextInt(); for(int i = 1; i <= N;i ++){ total += i; } System.out.println(total); } }
Main.java:10: error: variable total might not have been initialized total += i; ^ Main.java:12: error: variable total might not have been initialized System.out.println(total); ^ 2 errors
s784665568
p04029
Java
import java.util.*; class Main { public static void main(String[] args){ int total; Scanner sc = Scanner(System.in); int N = sc.nextInt(); for(int i = 1; i <= N;i ++){ total += i; } System.out.println(total); } }
Main.java:7: error: cannot find symbol Scanner sc = Scanner(System.in); ^ symbol: method Scanner(InputStream) location: class Main 1 error
s460944389
p04029
Java
import java.util.*; class Main { public static void main(String[] args){ int total; Scanner sc = Scanner(System.in); int N = sc.nextInt(); for(int i = 1, i <= N, i ++){ total += i; } System.out.println(total); } }
Main.java:9: error: ';' expected for(int i = 1, i <= N, i ++){ ^ Main.java:9: error: illegal start of expression for(int i = 1, i <= N, i ++){ ^ Main.java:9: error: ';' expected for(int i = 1, i <= N, i ++){ ^ 3 errors
s986669836
p04029
C++
#include <bits/stdc++.h> using namespace std; int sum( int N ) { if( N == 0 ) //基底部 { return 0; } else //再帰部 { return sum( N - 1 ) + 1; } }
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s183768248
p04029
C++
#include<bits/stdc++.h> using namespace std int main() { int n; cin>>n; cout<<(n)*(n-1)/2; return 0; }
a.cc:2:20: error: expected ';' before 'int' 2 | using namespace std | ^ | ; 3 | 4 | int main() | ~~~
s679125631
p04029
C++
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int sum=0; for (i=1;i<=n;i++) sum +=i; cout << sum << endl; return 0; }
a.cc: In function 'int main()': a.cc:8:8: error: 'i' was not declared in this scope 8 | for (i=1;i<=n;i++) sum +=i; | ^
s278786726
p04029
C++
int a,b,c; cin>>a>>b; for(int c=1;c<=3;c++){ if(c*a*b%2!=0){ cout<<"Yes"; return 0; } else{ cout<<"No"; return 0; } }
a.cc:2:5: error: 'cin' does not name a type 2 | cin>>a>>b; | ^~~ a.cc:3:5: error: expected unqualified-id before 'for' 3 | for(int c=1;c<=3;c++){ | ^~~ a.cc:3:17: error: 'c' does not name a type 3 | for(int c=1;c<=3;c++){ | ^ a.cc:3:22: error: 'c' does not name a type 3 | for(int c=1;c<=3;c++){ | ^
s558508125
p04029
Java
import java.util.*; public class Main{ puboic static void main(String[] args){ Scanner sc=new Scanner(System.in); final int N=sc.nextInt(); int answer=0; for(int i=1;i<N+1;i++){ answer=answer+i; } System.out.println(answer); } }
Main.java:4: error: <identifier> expected puboic static void main(String[] args){ ^ 1 error
s343839926
p04029
C
#include <stdio.h> int main(void){ int N, sum, i; sacnf("%d", &N); for(i = 1; i < N; i++){ sum = sum + N; } printf("%d", sum); return 0; }
main.c: In function 'main': main.c:6:3: error: implicit declaration of function 'sacnf'; did you mean 'scanf'? [-Wimplicit-function-declaration] 6 | sacnf("%d", &N); | ^~~~~ | scanf
s271119626
p04029
C
#include <stdio.h> int main(void){ int a,i,N; scanf("%d¥n",&a); for(i=0,i<=a,i++){ N +=i; } printf("%d",N); return 0; }
main.c: In function 'main': main.c:6:19: error: expected ';' before ')' token 6 | for(i=0,i<=a,i++){ | ^ | ; main.c:6:19: error: expected expression before ')' token
s712886763
p04029
Java
Scanner scan = new Scanner(System.in); int line = scan.nextInt(); int sum = 0; for(int i=1; i<line+1; i++) { sum += i; } System.out.println(sum);
Main.java:1: error: unnamed classes are a preview feature and are disabled by default. Scanner scan = new Scanner(System.in); ^ (use --enable-preview to enable unnamed classes) Main.java:6: error: class, interface, enum, or record expected for(int i=1; i<line+1; i++) { ^ Main.java:6: error: class, interface, enum, or record expected for(int i=1; i<line+1; i++) { ^ Main.java:6: error: class, interface, enum, or record expected for(int i=1; i<line+1; i++) { ^ Main.java:8: error: class, interface, enum, or record expected } ^ 5 errors
s542214373
p04029
C++
namespace ABC043A { class Program { static void Main(string[] args) { int n; //人数 int s;//必要な枚数 int i; //人数を入力 n = int.Parse(Console.ReadLine()); //必要な枚数を求める //(合計を求めるメルアルゴリズム) s = 0; //合計を0に初期化 for (i=1; i<=n; i++) //i→0の繰り返し { s = s + i; // sを1増やす } //出力 Console.WriteLine(s); } } }
a.cc:15:35: error: extended character   is not valid in an identifier 15 | for (i=1; i<=n; i++) //i→0の繰り返し | ^ a.cc:17:27: error: extended character   is not valid in an identifier 17 | s = s + i; // sを1増やす | ^ a.cc:5:26: error: 'string' has not been declared 5 | static void Main(string[] args) | ^~~~~~ a.cc:5:35: error: expected ',' or '...' before 'args' 5 | static void Main(string[] args) | ^~~~ a.cc:23:6: error: expected ';' after class definition 23 | } | ^ | ; a.cc: In static member function 'static void ABC043A::Program::Main(int*)': a.cc:11:17: error: expected primary-expression before 'int' 11 | n = int.Parse(Console.ReadLine()); | ^~~ a.cc:15:35: error: '\U00003000' was not declared in this scope 15 | for (i=1; i<=n; i++) //i→0の繰り返し | ^~ a.cc:21:13: error: 'Console' was not declared in this scope 21 | Console.WriteLine(s); | ^~~~~~~
s253117052
p04029
C++
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApplication3 { class Program { static void Main(string[] args) { int N;//人数 int S;//必要な個数 int I; //人数Nを入力 N = int.Parse(Console.ReadLine()); //必要な個数Sを求める //(合計を求めるアルゴリズム) S = 0; for (I=1;I<=N;I++)    { S = S + 1; }//SをI増やす S+=Iでもよい //Sを出力(表示) Console.WriteLine(S); //入力待ちに Console.ReadKey(); } } }
a.cc:22:2: error: extended character   is not valid in an identifier 22 |    { S = S + 1; }//SをI増やす S+=Iでもよい | ^ a.cc:22:2: error: extended character   is not valid in an identifier a.cc:22:2: error: extended character   is not valid in an identifier a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System; | ^~~~~~ a.cc:2:7: error: expected nested-name-specifier before 'System' 2 | using System.Collections.Generic; | ^~~~~~ a.cc:3:7: error: expected nested-name-specifier before 'System' 3 | using System.Linq; | ^~~~~~ a.cc:4:7: error: expected nested-name-specifier before 'System' 4 | using System.Text; | ^~~~~~ a.cc:5:7: error: expected nested-name-specifier before 'System' 5 | using System.Threading.Tasks; | ^~~~~~ a.cc:11:26: error: 'string' has not been declared 11 | static void Main(string[] args) | ^~~~~~ a.cc:11:35: error: expected ',' or '...' before 'args' 11 | static void Main(string[] args) | ^~~~ a.cc:28:6: error: expected ';' after class definition 28 | } | ^ | ; a.cc: In static member function 'static void ConsoleApplication3::Program::Main(int*)': a.cc:17:14: error: expected primary-expression before 'int' 17 | N = int.Parse(Console.ReadLine()); | ^~~ a.cc:22:2: error: '\U00003000\U00003000\U00003000' was not declared in this scope 22 |    { S = S + 1; }//SをI増やす S+=Iでもよい | ^~~~~~ a.cc:24:13: error: 'Console' was not declared in this scope 24 | Console.WriteLine(S); | ^~~~~~~
s332423355
p04029
C++
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ABC043A { class Program { static void Main(string[] args) { int n; //人数 int s;//必要な枚数 int i; //人数を入力 n = int.Parse(Console.ReadLine()); //必要な枚数を求める //(合計を求めるメルアルゴリズム) s = 0; //合計を0に初期化 for (i=1; i<=n; i++) //i→0の繰り返し { s = s + i; // sを1増やす } //出力 Console.WriteLine(s); } } }
a.cc:21:35: error: extended character   is not valid in an identifier 21 | for (i=1; i<=n; i++) //i→0の繰り返し | ^ a.cc:23:27: error: extended character   is not valid in an identifier 23 | s = s + i; // sを1増やす | ^ a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System; | ^~~~~~ a.cc:2:7: error: expected nested-name-specifier before 'System' 2 | using System.Collections.Generic; | ^~~~~~ a.cc:3:7: error: expected nested-name-specifier before 'System' 3 | using System.Linq; | ^~~~~~ a.cc:4:7: error: expected nested-name-specifier before 'System' 4 | using System.Text; | ^~~~~~ a.cc:5:7: error: expected nested-name-specifier before 'System' 5 | using System.Threading.Tasks; | ^~~~~~ a.cc:11:26: error: 'string' has not been declared 11 | static void Main(string[] args) | ^~~~~~ a.cc:11:35: error: expected ',' or '...' before 'args' 11 | static void Main(string[] args) | ^~~~ a.cc:29:6: error: expected ';' after class definition 29 | } | ^ | ; a.cc: In static member function 'static void ABC043A::Program::Main(int*)': a.cc:17:17: error: expected primary-expression before 'int' 17 | n = int.Parse(Console.ReadLine()); | ^~~ a.cc:21:35: error: '\U00003000' was not declared in this scope 21 | for (i=1; i<=n; i++) //i→0の繰り返し | ^~ a.cc:27:13: error: 'Console' was not declared in this scope 27 | Console.WriteLine(s); | ^~~~~~~
s404000578
p04029
C++
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ABC043A { class Program { static void Main(string[] args) { int n; //人数 int s;//必要な枚数 int i; //人数を入力 n = int.Parse(Console.ReadLine()); //必要な枚数を求める //(合計を求めるメルアルゴリズム) s = 0; //合計を0に初期化 for (i=1; i<=n; i++) //i→0の繰り返し { s = s + i; // sを1増やす } //出力 Console.WriteLine(s); } } }
a.cc:21:35: error: extended character   is not valid in an identifier 21 | for (i=1; i<=n; i++) //i→0の繰り返し | ^ a.cc:23:27: error: extended character   is not valid in an identifier 23 | s = s + i; // sを1増やす | ^ a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System; | ^~~~~~ a.cc:2:7: error: expected nested-name-specifier before 'System' 2 | using System.Collections.Generic; | ^~~~~~ a.cc:3:7: error: expected nested-name-specifier before 'System' 3 | using System.Linq; | ^~~~~~ a.cc:4:7: error: expected nested-name-specifier before 'System' 4 | using System.Text; | ^~~~~~ a.cc:5:7: error: expected nested-name-specifier before 'System' 5 | using System.Threading.Tasks; | ^~~~~~ a.cc:11:26: error: 'string' has not been declared 11 | static void Main(string[] args) | ^~~~~~ a.cc:11:35: error: expected ',' or '...' before 'args' 11 | static void Main(string[] args) | ^~~~ a.cc:29:6: error: expected ';' after class definition 29 | } | ^ | ; a.cc: In static member function 'static void ABC043A::Program::Main(int*)': a.cc:17:17: error: expected primary-expression before 'int' 17 | n = int.Parse(Console.ReadLine()); | ^~~ a.cc:21:35: error: '\U00003000' was not declared in this scope 21 | for (i=1; i<=n; i++) //i→0の繰り返し | ^~ a.cc:27:13: error: 'Console' was not declared in this scope 27 | Console.WriteLine(s); | ^~~~~~~
s892441783
p04029
C++
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApplication3 { class Program { static void Main(string[] args) { int N;//人数 int S;//必要な個数 int I; //人数Nを入力 N = int.Parse(Console.ReadLine()); //必要な個数Sを求める //(合計を求めるアルゴリズム) S = 0; for (I=1;I<=N;I++)    { S = S + 1; }//SをI増やす S+=Iでもよい //Sを出力(表示) Console.WriteLine(S); //入力待ちに Console.ReadKey(); } } }
a.cc:22:2: error: extended character   is not valid in an identifier 22 |    { S = S + 1; }//SをI増やす S+=Iでもよい | ^ a.cc:22:2: error: extended character   is not valid in an identifier a.cc:22:2: error: extended character   is not valid in an identifier a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System; | ^~~~~~ a.cc:2:7: error: expected nested-name-specifier before 'System' 2 | using System.Collections.Generic; | ^~~~~~ a.cc:3:7: error: expected nested-name-specifier before 'System' 3 | using System.Linq; | ^~~~~~ a.cc:4:7: error: expected nested-name-specifier before 'System' 4 | using System.Text; | ^~~~~~ a.cc:5:7: error: expected nested-name-specifier before 'System' 5 | using System.Threading.Tasks; | ^~~~~~ a.cc:11:26: error: 'string' has not been declared 11 | static void Main(string[] args) | ^~~~~~ a.cc:11:35: error: expected ',' or '...' before 'args' 11 | static void Main(string[] args) | ^~~~ a.cc:28:6: error: expected ';' after class definition 28 | } | ^ | ; a.cc: In static member function 'static void ConsoleApplication3::Program::Main(int*)': a.cc:17:14: error: expected primary-expression before 'int' 17 | N = int.Parse(Console.ReadLine()); | ^~~ a.cc:22:2: error: '\U00003000\U00003000\U00003000' was not declared in this scope 22 |    { S = S + 1; }//SをI増やす S+=Iでもよい | ^~~~~~ a.cc:24:13: error: 'Console' was not declared in this scope 24 | Console.WriteLine(S); | ^~~~~~~
s248050761
p04029
C++
#include <bits/stdc++.h> using namespace std; int main() { int N,result; cin >> n; cout << (1 + n)*n/2; return 0; }
a.cc: In function 'int main()': a.cc:4:24: error: 'n' was not declared in this scope 4 | int N,result; cin >> n; | ^
s669389296
p04029
C++
#include "stdio.h" #include <iostream> int main (){ int number = -1; while (number < 0 || number>100) { printf ("Please input the number of the children\n"); scanf ("%d",&number); if (number > 100 || number < 0) { printf("Please check the number you input\n"); } } int sum = 0; for (int i = 0; i < number; i++) { sum = sum + i + 1; } printf("The number of candies needed is"); printf("%d", sum); return 0; }
a.cc: In function 'int main()': a.cc:17:15: error: 'sum\U0000ff09' was not declared in this scope 17 | printf("%d", sum); | ^~~~~
s279396164
p04029
C++
#include "stdio.h" #include <iostream> int main (){ int number = -1; while (number < 0 || number>100) { printf ("Please input the number of the children\n"); scanf ("%d",&number); if (number > 100 || number < 0) { printf("Please check the number you input\n"); } } int sum = 0; for (int i = 0; i < number; i++) { sum = sum + i + 1; } printf("The number of candies needed is"); printf("%d", sum); return 0; }
a.cc: In function 'int main()': a.cc:17:15: error: 'sum\U0000ff09' was not declared in this scope 17 | printf("%d", sum); | ^~~~~
s146200707
p04029
C++
#include <stdio.h> int main() { int number = -1; while (number < 0 || number>100) { cout << "Please input the number of the children" << endl; cin >> number; if (number > 100 || number < 0) { cout << "Please check the number you input" << endl; } } int sum = 0; for (int i = 0; i < number; i++) { sum = sum + i + 1; } cout << "The number of candies needed is:" << sum << endl; return 0; }
a.cc:4:9: error: expected primary-expression before 'int' 4 | int number = -1; | ^~~ a.cc:4:9: error: expected '}' before 'int' a.cc:3:1: note: to match this '{' 3 | { | ^ a.cc:5:9: error: expected unqualified-id before 'while' 5 | while (number < 0 || number>100) { | ^~~~~ a.cc:13:9: error: expected unqualified-id before 'for' 13 | for (int i = 0; i < number; i++) { | ^~~ a.cc:13:25: error: 'i' does not name a type 13 | for (int i = 0; i < number; i++) { | ^ a.cc:13:37: error: 'i' does not name a type 13 | for (int i = 0; i < number; i++) { | ^ a.cc:16:9: error: 'cout' does not name a type 16 | cout << "The number of candies needed is:" << sum << endl; | ^~~~ a.cc:17:9: error: expected unqualified-id before 'return' 17 | return 0; | ^~~~~~ a.cc:18:1: error: expected declaration before '}' token 18 | } | ^
s457838168
p04029
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 N; cin >> N; cout << (N*(N + 1)) / 2 << endl }
a.cc: In function 'int main()': a.cc:10:36: error: expected ';' before '}' token 10 | cout << (N*(N + 1)) / 2 << endl | ^ | ; 11 | } | ~
s819880028
p04029
C++
#include<stdio.h> main() { int i,sum=0,n; scanf("%d",&n); for(i=1;i<=n;++i) sum+=i; printf(S(%d)=%d\n",sum); return 0; }
a.cc:8:24: error: stray '\' in program 8 | printf(S(%d)=%d\n",sum); | ^ a.cc:8:26: warning: missing terminating " character 8 | printf(S(%d)=%d\n",sum); | ^ a.cc:8:26: error: missing terminating " character 8 | printf(S(%d)=%d\n",sum); | ^~~~~~~ a.cc:2:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 2 | main() | ^~~~ a.cc: In function 'int main()': a.cc:8:18: error: expected primary-expression before '%' token 8 | printf(S(%d)=%d\n",sum); | ^ a.cc:8:19: error: 'd' was not declared in this scope 8 | printf(S(%d)=%d\n",sum); | ^ a.cc:8:16: error: 'S' was not declared in this scope 8 | printf(S(%d)=%d\n",sum); | ^ a.cc:8:22: error: expected primary-expression before '%' token 8 | printf(S(%d)=%d\n",sum); | ^
s679248392
p04029
C++
#include<stddio.h> main() { int i,sum=0,n; scanf("%d",&n); for(i=1;i<=n;++i) sum+=i; printf(S(%d)=%d\n",sum); return 0; }
a.cc:1:9: fatal error: stddio.h: No such file or directory 1 | #include<stddio.h> | ^~~~~~~~~~ compilation terminated.
s193629881
p04029
C++
#include<stdio.h> main() { int i,sum=0,n; scanf("%d",&n); for(i=1;i<=n;++i) sum+=i; pprintf(S(%d)=%d\n",sum); return 0; }
a.cc:8:25: error: stray '\' in program 8 | pprintf(S(%d)=%d\n",sum); | ^ a.cc:8:27: warning: missing terminating " character 8 | pprintf(S(%d)=%d\n",sum); | ^ a.cc:8:27: error: missing terminating " character 8 | pprintf(S(%d)=%d\n",sum); | ^~~~~~~ a.cc:2:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 2 | main() | ^~~~ a.cc: In function 'int main()': a.cc:8:19: error: expected primary-expression before '%' token 8 | pprintf(S(%d)=%d\n",sum); | ^ a.cc:8:20: error: 'd' was not declared in this scope 8 | pprintf(S(%d)=%d\n",sum); | ^ a.cc:8:17: error: 'S' was not declared in this scope 8 | pprintf(S(%d)=%d\n",sum); | ^ a.cc:8:23: error: expected primary-expression before '%' token 8 | pprintf(S(%d)=%d\n",sum); | ^
s134053116
p04029
C++
#include<stddio.h> main() { int i,sum=0,n; scanf("%d",&n); for(i=1;i<=n;++i) sum+=i; pprintf(S(%d)=%d\n",sum); return 0; }
a.cc:1:9: fatal error: stddio.h: No such file or directory 1 | #include<stddio.h> | ^~~~~~~~~~ compilation terminated.
s589462803
p04029
C
#include<stdio.h> int main(){ int N;//子供の数 int sum=0; scanf(%d,N); for(int i=N;N>0;N--){ sum=sum+i; } return 0; }
main.c: In function 'main': main.c:5:15: error: expected expression before '%' token 5 | scanf(%d,N); | ^
s112729993
p04029
C
#include<iostream> int main(){ int N;//子供の数 int sum=0; scanf(%d,N); for(int i=N;N>0;N--){ sum=sum+i; } return 0; }
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s594655246
p04029
C++
int main(){ int sum=0,N; cin >> N; for(int i=1;i<=N;i++){ sum += i; } cout << sum; }
a.cc: In function 'int main()': a.cc:3:3: error: 'cin' was not declared in this scope 3 | cin >> N; | ^~~ a.cc:7:3: error: 'cout' was not declared in this scope 7 | cout << sum; | ^~~~
s494659311
p04029
C++
int main(){ int sum=0; cin >> N; for(int i=1;i<=N;i++){ sum += i; } cout << sum; }
a.cc: In function 'int main()': a.cc:3:3: error: 'cin' was not declared in this scope 3 | cin >> N; | ^~~ a.cc:3:10: error: 'N' was not declared in this scope 3 | cin >> N; | ^ a.cc:7:3: error: 'cout' was not declared in this scope 7 | cout << sum; | ^~~~
s391363159
p04029
C++
#include<stdio.h> int main() { int N, candies; scanf("%d",&n); candies = ((N*N+N)/2); printf("%d",candies); return 0; }
a.cc: In function 'int main()': a.cc:5:21: error: 'n' was not declared in this scope 5 | scanf("%d",&n); | ^
s465262222
p04029
C++
#include<stdio.h> int main() { int i,n,sum; scanf("%d",&n); sum=0; for(i = 1;i <= n;i++) { sum=sum+i; } printf("sum = %d\n",sum); return 0; }
a.cc: In function 'int main()': a.cc:8:4: error: '\U0000ff5b' was not declared in this scope 8 | { | ^~ a.cc:10:7: error: '\U0000ff5d' was not declared in this scope 10 | } | ^~
s518420018
p04029
C++
#include <stdio.h> int main() { int i=1; int sum=0; int n scanf("%d",n); do { sum=sum+i; i++; }while(i<=n); printf(%d\n,sum); return 0; }
a.cc:14:14: error: stray '\' in program 14 | printf(%d\n,sum); | ^ a.cc: In function 'int main()': a.cc:8:9: error: expected initializer before 'scanf' 8 | scanf("%d",n); | ^~~~~ a.cc:13:15: error: 'n' was not declared in this scope 13 | }while(i<=n); | ^ a.cc:14:12: error: expected primary-expression before '%' token 14 | printf(%d\n,sum); | ^ a.cc:14:13: error: 'd' was not declared in this scope 14 | printf(%d\n,sum); | ^
s443427629
p04029
C++
#include <stdio.h> int add(int n){ int i=1,sum=0; while(i<=n){ sum=sum+i; i++; } return sum; }
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s340355833
p04029
C++
#include<stdio.h> int main() { printf("%d",(1+100)*50); return 0; }
a.cc:2:5: error: cannot declare '::main' to be a global variable 2 | int main() | ^~~~ a.cc:2:10: error: '\U0000ff09' was not declared in this scope 2 | int main() | ^~
s058440164
p04029
C++
# include<stdio.h> int main() { int i, j=0; for(i = 1;i<=100;i++) { j+=i; } printf("%d%,j); return 0; }
a.cc:9:8: warning: missing terminating " character 9 | printf("%d%,j); | ^ a.cc:9:8: error: missing terminating " character 9 | printf("%d%,j); | ^~~~~~~~ a.cc: In function 'int main()': a.cc:10:1: error: expected primary-expression before 'return' 10 | return 0; | ^~~~~~
s300435580
p04029
C++
public class forew { /** * @param args */ public static void main(String[] args) { int sum=0; for (int i = 1; i <=100;i++) sum+=i; sum+=i; } System.out.println(sum); } }
a.cc:1:1: error: expected unqualified-id before 'public' 1 | public class forew { | ^~~~~~ a.cc:14:1: error: expected declaration before '}' token 14 | } | ^
s165970961
p04029
C++
#include<stdio.h> int add(int n) { if(n < 1) return 0; return n + add(n - 1); } int main(void) { printf("%d\n",add(100)); return 0; }
a.cc: In function 'int add(int)': a.cc:6:20: error: 'add\U0000ff08n' was not declared in this scope 6 | return n + add(n - 1); | ^~~~~~ a.cc:6:30: error: expected ';' before ')' token 6 | return n + add(n - 1); | ^ | ; a.cc:6:30: error: expected primary-expression before ')' token
s180571660
p04029
C++
public class forew { /** *@param args */ public static void main(string[] args) { int sum=0 for (int i=1;i<=100; i++) { sum+=i; } System.out.println(sum); } }
a.cc:1:1: error: expected unqualified-id before 'public' 1 | public class forew { | ^~~~~~
s960595615
p04029
C++
#include <stdio.h> int main() { int i,sum=0; for(i=1;i<=100;i++) sum=sum+i; printf("%d,sum); }
a.cc:7:16: warning: missing terminating " character 7 | printf("%d,sum); | ^ a.cc:7:16: error: missing terminating " character 7 | printf("%d,sum); | ^~~~~~~~~ a.cc: In function 'int main()': a.cc:8:1: error: expected primary-expression before '}' token 8 | } | ^
s268929470
p04029
C++
#include<stdio.h> void main() { int i,sum; sum=0; for(i=1;i<=100;i++) sum=sum+i; printf("1+2+3...+100=%d\n",sum); }
a.cc:2:1: error: '::main' must return 'int' 2 | void main() | ^~~~
s988657905
p04029
C++
#include<stdio.h> int main() { int i,n,sum; printf("Input n:") scanf("%d",&n); sum=0; for(i = 1;i <= n;i++) { sum = sum + i; } printf("sum = %d\n",sum); }
a.cc: In function 'int main()': a.cc:5:27: error: expected ';' before 'scanf' 5 | printf("Input n:") | ^ | ; 6 | scanf("%d",&n); | ~~~~~ a.cc:9:4: error: '\U0000ff5b' was not declared in this scope 9 | { | ^~ a.cc:11:7: error: '\U0000ff5d' was not declared in this scope 11 | } | ^~
s292611647
p04029
C++
#include<stdio.h> int main() { int i,n,sum; printf("input n:"); scanf("%d",&n); sum=0; for(i = 1;i <= n;i++) { sum=sum+i; } printf("sum = %d\n",sum); return 0; }
a.cc: In function 'int main()': a.cc:9:4: error: '\U0000ff5b' was not declared in this scope 9 | { | ^~ a.cc:11:7: error: '\U0000ff5d' was not declared in this scope 11 | } | ^~
s436445519
p04029
C++
#include<stdio.h> int main() int i,1 <=n <=100,sum=0; for(i = 1;i <= n;i++) { sum=sum+i; } printf("sum = %d\n",sum); return 0; }
a.cc:3:8: error: expected initializer before 'int' 3 | int i,1 <=n <=100,sum=0; | ^~~ a.cc:4:8: error: expected unqualified-id before 'for' 4 | for(i = 1;i <= n;i++) | ^~~ a.cc:4:18: error: 'i' does not name a type 4 | for(i = 1;i <= n;i++) | ^ a.cc:4:25: error: 'i' does not name a type 4 | for(i = 1;i <= n;i++) | ^ a.cc:7:7: error: '\U0000ff5d' does not name a type 7 | } | ^~ a.cc:9:8: error: expected unqualified-id before 'return' 9 | return 0; | ^~~~~~ a.cc:10:1: error: expected declaration before '}' token 10 | } | ^
s246940453
p04029
C++
#include<stdio.h> int main() { int i,n,sum; printf("input n:"); scanf("%d",&n); sum=0;1 <= n <= 100; for(i = 1;i <= n;i++) { sum=sum+i; } printf("sum = %d\n",sum); return 0; }
a.cc: In function 'int main()': a.cc:9:4: error: '\U0000ff5b' was not declared in this scope 9 | { | ^~ a.cc:11:7: error: '\U0000ff5d' was not declared in this scope 11 | } | ^~
s614891956
p04029
C++
#include<stdio.h> int main() { int i,n,sum; printf("input n:",0<n<101); scanf("%d",&n); sum=0; for(i = 1;i <= n;i++) { sum=sum+i; } printf("sum = %d\n",sum); return 0; }
a.cc: In function 'int main()': a.cc:9:4: error: '\U0000ff5b' was not declared in this scope 9 | { | ^~ a.cc:11:7: error: '\U0000ff5d' was not declared in this scope 11 | } | ^~
s906637414
p04029
C++
#include<stdio.h> int main() { int i,n,sum; printf("input n:",0<n<101); scanf("%d",&n); sum=0; for(i = 1;i <= 100;i++) { sum=sum+i; } printf("sum = %d\n",sum); return 0; }
a.cc: In function 'int main()': a.cc:9:4: error: '\U0000ff5b' was not declared in this scope 9 | { | ^~ a.cc:11:7: error: '\U0000ff5d' was not declared in this scope 11 | } | ^~
s935888706
p04029
C++
#include<stdio.h> int main() { int i,sum = 0; for(i = 1;i <= 100;i++) { sum=sum+i; } printf("sum = %d\n",sum); }
a.cc: In function 'int main()': a.cc:6:4: error: '\U0000ff5b' was not declared in this scope 6 | { | ^~ a.cc:8:7: error: '\U0000ff5d' was not declared in this scope 8 | } | ^~
s314864491
p04029
C++
#include<iostream> using namespace std; int main(void){ int a,sum = 0; cin >> a; for(int i = 1;i =< a;i++){ sum += i; } cout << sum << endl; return 0; }
a.cc: In function 'int main()': a.cc:6:20: error: expected primary-expression before '<' token 6 | for(int i = 1;i =< a;i++){ | ^
s745430274
p04029
C++
#include<stdio.h> main() { int N,j,sum; printf("Input n:"); scanf("%d",&N); sum = 0; j = 1; while(j <= N) { sum = sum + j; j++{ } printf("sum=%d\n",sum); return 0; }
a.cc:2:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 2 | main() | ^~~~ a.cc: In function 'int main()': a.cc:12:12: error: expected ';' before '{' token 12 | j++{ | ^ | ; a.cc:16:2: error: expected '}' at end of input 16 | } | ^ a.cc:3:1: note: to match this '{' 3 | { | ^
s468567711
p04029
C++
#include<stdio.h> main() { int N,j,sum; printf("Input n:"); scanf("%d",&N); sum = 0; j = 1; while(j <= N) s sum = sum + j; j++; } printf("sum=%d\n",sum); return 0; }
a.cc:2:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 2 | main() | ^~~~ a.cc: In function 'int main()': a.cc:10:5: error: 's' was not declared in this scope 10 | s | ^ a.cc: At global scope: a.cc:14:11: error: expected constructor, destructor, or type conversion before '(' token 14 | printf("sum=%d\n",sum); | ^ a.cc:15:5: error: expected unqualified-id before 'return' 15 | return 0; | ^~~~~~ a.cc:16:1: error: expected declaration before '}' token 16 | } | ^
s999390216
p04029
C++
#include <stdio.h> main() { int sum=0; for(int i=1;i<=100;i++) { sum=sum+i; }
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 3 | main() | ^~~~ a.cc: In function 'int main()': a.cc:13:2: error: expected '}' at end of input 13 | } | ^ a.cc:5:1: note: to match this '{' 5 | { | ^
s475482070
p04029
C++
#include <iostream.h> int main() { int sum=0; for(int i=1;i<=100;i++) { sum=sum+i; } return 0; }
a.cc:1:10: fatal error: iostream.h: No such file or directory 1 | #include <iostream.h> | ^~~~~~~~~~~~ compilation terminated.
s754957647
p04029
C++
#include <stdio.h> main() { int sum=0; for(int i=1;i<=100;i++) { sum=sum+i; } cout<<sum<<endl; return 0; }
a.cc:2:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 2 | main() | ^~~~ a.cc: In function 'int main()': a.cc:16:1: error: 'cout' was not declared in this scope 16 | cout<<sum<<endl; | ^~~~ a.cc:16:12: error: 'endl' was not declared in this scope 16 | cout<<sum<<endl; | ^~~~
s279290748
p04029
C++
#include <iostream.h> int main() { int sum=0; for(int i=1;i<=100;i++) { sum=sum+i; } cout<<sum<<endl; return 0; }
a.cc:1:10: fatal error: iostream.h: No such file or directory 1 | #include <iostream.h> | ^~~~~~~~~~~~ compilation terminated.
s939139000
p04029
C++
#include<stdio.h> main() { int a; for(a=1;a<=100;a++) printf(“a=%d:”,a); return 0; }
a.cc:6:16: error: extended character “ is not valid in an identifier 6 | printf(“a=%d:”,a); | ^ a.cc:6:22: error: extended character ” is not valid in an identifier 6 | printf(“a=%d:”,a); | ^ a.cc:2:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 2 | main() | ^~~~ a.cc: In function 'int main()': a.cc:6:16: error: '\U0000201ca' was not declared in this scope 6 | printf(“a=%d:”,a); | ^~ a.cc:6:19: error: expected primary-expression before '%' token 6 | printf(“a=%d:”,a); | ^ a.cc:6:21: error: found ':' in nested-name-specifier, expected '::' 6 | printf(“a=%d:”,a); | ^ | :: a.cc:6:20: error: 'd' has not been declared 6 | printf(“a=%d:”,a); | ^
s932814569
p04029
C++
#include<studio.h> main() { int a; for(a=1;a<=100;a++) printf(“a=%d:”,a); return 0; }
a.cc:1:9: fatal error: studio.h: No such file or directory 1 | #include<studio.h> | ^~~~~~~~~~ compilation terminated.
s249610220
p04029
C
#include<stdio.h> int main(){ int n; scanf("%d",&n); printf("%d",(n+1)n/2); return 0; }
main.c: In function 'main': main.c:5:20: error: expected ')' before 'n' 5 | printf("%d",(n+1)n/2); | ~ ^ | )
s206670713
p04029
C
#include<stdio.h> int main(){ int n; printf("幼稚園児の人数を入力してください"); scanf("%d",&n); printf("%d",(n+1)n/2); return 0; }
main.c: In function 'main': main.c:6:20: error: expected ')' before 'n' 6 | printf("%d",(n+1)n/2); | ~ ^ | )
s555375130
p04029
C++
#include <bits/stdc++.h> using namespace std; int main() { int a; cin >> a; cout << n*(n+1)/2 << endl; }
a.cc: In function 'int main()': a.cc:7:11: error: 'n' was not declared in this scope 7 | cout << n*(n+1)/2 << endl; | ^
s951916681
p04029
C++
#include<bits\stdc++.h> using namespace std; int main() { int n,sum=0; cin>>n; for(int i=1;i<=n;i++) { sum+=i; } cout<<sum<<endl; return 0; }
a.cc:1:9: fatal error: bits\stdc++.h: No such file or directory 1 | #include<bits\stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s122550327
p04029
C++
#include<bits\stdc++.h> using namespace std; int main() { int n,sum=0; cin>>n; for(int i=1;i<=n;i++) { sum+=i; } cout<<sum<<endl; return 0; }
a.cc:1:9: fatal error: bits\stdc++.h: No such file or directory 1 | #include<bits\stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s220841849
p04029
C++
#include<bits/sydc++.h> using namespace std; int main(){ int a,b=0; cin>>a; for(int i=1;i<=a;i++){ b=b+a; } cout<<b<<"\n"; }
a.cc:1:9: fatal error: bits/sydc++.h: No such file or directory 1 | #include<bits/sydc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s217361140
p04029
C++
#include<iostream> using namespace std; main(i){cin>>i;cout<<(i*(i-1)/2)<<endl;}
a.cc:3:5: error: expected constructor, destructor, or type conversion before '(' token 3 | main(i){cin>>i;cout<<(i*(i-1)/2)<<endl;} | ^
s321025146
p04029
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; ans = ((1 + n)*n)/2; cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:7:3: error: 'ans' was not declared in this scope; did you mean 'abs'? 7 | ans = ((1 + n)*n)/2; | ^~~ | abs
s858700257
p04029
C
#include <stdio.h> int main(){ int N; int sum=0;  //Nの値を入力する scanf("%d",&N); if(1<=N&&N<=100){ for(int i=1;i<=N;i++){ sum=sum+i; } printf("%d",sum); } return 0; }
main.c: In function 'main': main.c:5:3: error: stray '\343' in program 5 | <U+3000>//N<U+306E><U+5024><U+3092><U+5165><U+529B><U+3059><U+308B> | ^~~~~~~~
s317083497
p04029
C++
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; int sum = 0; for (i = 1; i < N+1; i++) sum += i; cout << sum << endl; }
a.cc: In function 'int main()': a.cc:8:8: error: 'i' was not declared in this scope 8 | for (i = 1; i < N+1; i++) | ^
s788201669
p04029
C++
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int n=s.size(); string vec(n); for(int i=0;i<n;i++){ if(s[i]=='0'){ vec.push_back(s[i]); } else if(s[i]=='1'){ vec.push_back(s[i]); } else { vec.pop_back(); } } cout<<vec<<endl; }
a.cc: In function 'int main()': a.cc:8:17: error: no matching function for call to 'std::__cxx11::basic_string<char>::basic_string(int&)' 8 | string vec(n); | ^ In file included from /usr/include/c++/14/string:54, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52, from a.cc:1: /usr/include/c++/14/bits/basic_string.h:800:9: note: candidate: 'template<class _Tp, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Tp&, const _Alloc&) [with <template-parameter-2-2> = _Tp; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 800 | basic_string(const _Tp& __t, const _Alloc& __a = _Alloc()) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:800:9: note: template argument deduction/substitution failed: In file included from /usr/include/c++/14/bits/stl_pair.h:60, from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51: /usr/include/c++/14/type_traits: In substitution of 'template<bool _Cond, class _Tp> using std::enable_if_t = typename std::enable_if::type [with bool _Cond = false; _Tp = void]': /usr/include/c++/14/bits/basic_string.h:149:8: required by substitution of 'template<class _CharT, class _Traits, class _Alloc> template<class _Tp, class _Res> using std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv = std::enable_if_t<((bool)std::__and_<std::is_convertible<const _Tp&, std::basic_string_view<_CharT, _Traits> >, std::__not_<std::is_convertible<const _Tp*, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>*> >, std::__not_<std::is_convertible<const _Tp&, const _CharT*> > >::value), _Res> [with _Tp = int; _Res = void; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 149 | using _If_sv = enable_if_t< | ^~~~~~ /usr/include/c++/14/bits/basic_string.h:797:30: required from here 797 | template<typename _Tp, typename = _If_sv<_Tp, void>> | ^~~~~~~~ /usr/include/c++/14/type_traits:2711:11: error: no type named 'type' in 'struct std::enable_if<false, void>' 2711 | using enable_if_t = typename enable_if<_Cond, _Tp>::type; | ^~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:788:9: note: candidate: 'template<class _Tp, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Tp&, size_type, size_type, const _Alloc&) [with <template-parameter-2-2> = _Tp; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 788 | basic_string(const _Tp& __t, size_type __pos, size_type __n, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:788:9: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:765:9: note: candidate: 'template<class _InputIterator, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(_InputIterator, _InputIterator, const _Alloc&) [with <template-parameter-2-2> = _InputIterator; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 765 | basic_string(_InputIterator __beg, _InputIterator __end, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:765:9: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:669:7: note: candidate: 'template<class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(size_type, _CharT, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 669 | basic_string(size_type __n, _CharT __c, const _Alloc& __a = _Alloc()) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:669:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:646:7: note: candidate: 'template<class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 646 | basic_string(const _CharT* __s, const _Alloc& __a = _Alloc()) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:646:7: note: template argument deduction/substitution failed: a.cc:8:16: note: cannot convert 'n' (type 'int') to type 'const char*' 8 | string vec(n); | ^ /usr/include/c++/14/bits/basic_string.h:721:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 721 | basic_string(basic_string&& __str, const _Alloc& __a) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:721:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:716:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 716 | basic_string(const basic_string& __str, const _Alloc& __a) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:716:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:711:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::initializer_list<_Tp>, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 711 | basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc()) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:711:45: note: no known conversion for argument 1 from 'int' to 'std::initializer_list<char>' 711 | basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc()) | ~~~~~~~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/basic_string.h:682:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 682 | basic_string(basic_string&& __str) noexcept | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:682:35: note: no known conversion for argument 1 from 'int' to 'std::__cxx11::basic_string<char>&&' 682 | basic_string(basic_string&& __str) noexcept | ~~~~~~~~~~~~~~~^~~~~ /usr/include/c++/14/bits/basic_string.h:624:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 624 | basic_string(const _CharT* __s, size_type __n, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:624:7: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:604:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 604 | basic_string(const basic_string& __str, size_type __pos, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:604:7: note: candidate expects 4 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:586:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 586 | basic_string(const basic_string& __str, size_type __pos, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:586:7: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:569:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 569 | basic_string(const basic_string& __str, size_type __pos, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:569:7: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:552:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 552 | basic_string(const basic_string& __str) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:552:40: note: no known conversion for argument 1 from 'int' to 'const std::__cxx11::basic_string<char>&' 552 | basic_string(const basic_string& __str) | ~~~~~~~~~~~~~~~~~~~~^~~~~ /usr/include/c++/14/bits/basic_string.h:540:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 540 | basic_string(const _Alloc& __a) _GLIBCXX_NOEXCEPT | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:540:34: note: no known conversion for argument 1 from 'int' to 'const std::allocator<char>&' 540 | basic_string(const _Alloc& __a) _GLIBCXX_NOEXCEPT | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/basic_string.h:527:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string() [with _CharT = char; _
s255723927
p04029
Java
import java.util.Scanner; public class Atcoder { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int x = 0; for(int i = 1; i <= n; i++) { x += i; } System.out.println(x); } }
Main.java:3: error: class Atcoder is public, should be declared in a file named Atcoder.java public class Atcoder { ^ 1 error