criyle/codenet-compile-errors huggingface dataset:
Language: C++


#include<bits/stdc++.h>
using namespace std;
 
int main()
{
ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n,k,i,r=0,t=-1;
  cin>>n>>k;
  long long int a[n];
  
  for(i=0;i<n;i++)
  { cin>>a[i];
     r+=a[i];
   if(r>k && t=-1) t=i; 
  }
  cout<<t;
  return 0;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:11: error: lvalue required as left operand of assignment
   17 |    if(r>k && t=-1) t=i;
      |       ~~~~^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;

int main(){
  ios_base::sync_with_stdio(0); cin.tie(0)
   int n,x;
  cin >> n >> x;
  vector<int> v(n);
  for(auto &x:v) cin >> x;
  int tmp = 0; int cnt =0;
  for(int i=0;i<n;i++){
    tmp += v[i];
    cnt++;
    if(tmp > x){
      cout << cnt << "\n";
      break;
    }
    else if(tmp == x){
      cout << cnt+1 << "\n";
      break;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:43: error: expected ';' before 'int'
    5 |   ios_base::sync_with_stdio(0); cin.tie(0)
      |                                           ^
      |                                           ;
    6 |    int n,x;
      |    ~~~                                     
a.cc:7:10: error: 'n' was not declared in this scope; did you mean 'yn'?
    7 |   cin >> n >> x;
      |          ^
      |          yn
a.cc:7:15: error: 'x' was not declared in this scope
    7 |   cin >> n >> x;
      |               ^
a.cc:22:2: error: expected '}' at end of input
   22 | }
      |  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

mission #7559592

Source Code 

Copy
Copy
#include <stdio.h>
 
int main(void) {
 
	int A;
	int X;
 
	scanf("%d", &X);
	scanf("%d", &A);     
  
    if(X < A){
      puts("0");
    }
    else{
      puts("10");
    }
 
      
  
	return 0;
}

Compiler output:
a.cc:1:9: error: stray '#' in program
    1 | mission #7559592
      |         ^
a.cc:1:1: error: 'mission' does not name a type
    1 | mission #7559592
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:14:9: error: 'scanf' was not declared in this scope
   14 |         scanf("%d", &X);
      |         ^~~~~
a.cc:18:7: error: 'puts' was not declared in this scope
   18 |       puts("0");
      |       ^~~~
a.cc:21:7: error: 'puts' was not declared in this scope
   21 |       puts("10");
      |       ^~~~
Language: C++

#include <iostream>
#include <vector>
using namespace std;
int main(){
  int N,X;cin>>N>>X;
  vector<int> L(N+1); 
  L[0]=0;
  for (int i=1;i<N;++i){
    int x;cin>>x;
    L[i+1]=L[i]+x;
  }
  int ans=0;
  for (int i=1;i<N;++i){
    if (D[i]<=X)++ans;
  }
  cout<<ans<<endl;
}
    
  


Compiler output:
a.cc: In function 'int main()':
a.cc:14:9: error: 'D' was not declared in this scope
   14 |     if (D[i]<=X)++ans;
      |         ^
Language: C++

#include <iostream>
using namespace std;

int main(){
  int N, X;
  cin >> N >> X;
  vector<int> L(N);
  for(int i=0; i<N; i++){
    cin >> L.at(i);
  }
  int i=0;
  int dist=0;
  while(X>=dist){
    dist+=L.at(i);
    i++;
  }
  cout << i << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'vector' was not declared in this scope
    7 |   vector<int> L(N);
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:7:10: error: expected primary-expression before 'int'
    7 |   vector<int> L(N);
      |          ^~~
a.cc:9:12: error: 'L' was not declared in this scope
    9 |     cin >> L.at(i);
      |            ^
a.cc:14:11: error: 'L' was not declared in this scope
   14 |     dist+=L.at(i);
      |           ^
Language: C++

#include<iostream>
using namespace std;
int main(){
  int N, X;
  cin >> N >> X;
  int D = 0, cnt=1, L=0;
  for(int i=1; i<N; i++){
    cin >> L;
    if(D+L < X) cnt++;
    D = D+L
  }
  cout << cnt << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:12: error: expected ';' before '}' token
   10 |     D = D+L
      |            ^
      |            ;
   11 |   }
      |   ~
Language: C++

#include <iostream>
#include <vector>
using namespace std;
int main(){
  int N,X;cin>>N>>X;
  vector<int>L(N+1);
  L[0]=0;
  for (int i=0;i<N;++i){
    if (L[i+1]=L[i]+x){
      ans++;
    }
  }
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:21: error: 'x' was not declared in this scope
    9 |     if (L[i+1]=L[i]+x){
      |                     ^
a.cc:10:7: error: 'ans' was not declared in this scope; did you mean 'abs'?
   10 |       ans++;
      |       ^~~
      |       abs
a.cc:13:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   13 |   cout<<ans<<endl;
      |         ^~~
      |         abs
Language: C++

#include <iostream>
#include <vector>
using namespace std;
int main(){
  int N,X;cin>>N>>X;
  vector<int>L(N);
  for (int i=0;i<N;++i)cin>>L[i];
  int ans=0;
  int tmp=0;
  for (int j=0;j<N;++j){
    ans+=L[j];++tmp;    
    if (ans=>X) break;
  }
  cout<<tmp<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:13: error: expected primary-expression before '>' token
   12 |     if (ans=>X) break;
      |             ^
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>

using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define pb push_back
#define mp make_pair
int main()
{
    int n, x, nr;
    cin >> n >> x;
    vector<int> v;
    rep(i, n)
    {
        cin >> nr;
        v.pb(nr);
    }
    int d = 0;
    int bounces = 0;
    for (int i = 1; i < n ;i++)
    {
        d = d + v[i-1];
        if (d > x)
        {
            break;
        }
        bounces++;
    }
    cout << bounces + 1;
    return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:32:14: error: expected '}' at end of input
   32 |     return 0;
      |              ^
a.cc:11:1: note: to match this '{'
   11 | {
      | ^
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>
#include<string>
#include<numeric> //xとyの最大公約数は__gcd(x,y),xとyの最小公倍数は(x*y)/__gcd
typedef long long ll;
#define rep(i,n) for(ll i=0; i<n; i++)
#define vll vector<ll>
#define vi vector<int>
#define all(x) (x).begin(),(x).end()
#define mod 1000000007
using namespace std;
using namespace std;

int main(){
  int n,l,x,length=0,ans=0;
  cin >> n >> x;
  vi l(n);
  rep(i,n){
    cin >> l[i];
  }
  vi d(n+1);
  d[0] = 0;
  while (d[ans] <= x) {
    d[ans+1] = d[ans] + l[ans];
    ans++;
  }
  cout << ans;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:6: error: conflicting declaration 'std::vector<int> l'
   19 |   vi l(n);
      |      ^
a.cc:17:9: note: previous declaration as 'int l'
   17 |   int n,l,x,length=0,ans=0;
      |         ^
a.cc:21:13: error: invalid types 'int[ll {aka long long int}]' for array subscript
   21 |     cin >> l[i];
      |             ^
a.cc:26:26: error: invalid types 'int[int]' for array subscript
   26 |     d[ans+1] = d[ans] + l[ans];
      |                          ^
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>
#include<string>
#include<numeric> //xとyの最大公約数は__gcd(x,y),xとyの最小公倍数は(x*y)/__gcd
#define rep0_n(i,n) for(int i=0; i<n; i++)
#define rep1_n(i, n) for(int i=1; i<n+1; i++)
#define reps_n(i, s, n) for(int i=s; i<n; i++)
typedef long long ll;
using namespace std;

int main(){
  int n,l,x,length=0,ans=0;
  cin >> n >> x;
  vi l(n);
  rep(i,n){
    cin >> l[i];
  }
  vi d(n+1);
  d[0] = 0;
  while (d[ans] <= x) {
    d[ans+1] = d[ans] + l[ans];
    ans++;
  }
  cout << ans;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:3: error: 'vi' was not declared in this scope
   16 |   vi l(n);
      |   ^~
a.cc:17:7: error: 'i' was not declared in this scope
   17 |   rep(i,n){
      |       ^
a.cc:17:3: error: 'rep' was not declared in this scope; did you mean 'frexp'?
   17 |   rep(i,n){
      |   ^~~
      |   frexp
a.cc:20:5: error: expected ';' before 'd'
   20 |   vi d(n+1);
      |     ^~
      |     ;
a.cc:21:3: error: 'd' was not declared in this scope
   21 |   d[0] = 0;
      |   ^
a.cc:23:26: error: invalid types 'int[int]' for array subscript
   23 |     d[ans+1] = d[ans] + l[ans];
      |                          ^
Language: C++

#include <bits/stdc++.h>
#include <iostream>
#include <string>
#include <vector>
#include <stdio.h>
#include <algorithm>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <queue>
#include <set>
#include <map>

#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define for_p(i, a, b) for(int i = a; i < b; i++)
#define for_m(i, a, b) for(int i = a - 1; i >= b; i--)

//a = s1.size();
//vector<string> s1;
//string s2 = accumulate( s1.begin(), s1.end(), string() );

using namespace std;

int main()
{
  int a = 0 , b = 0, c = 0, d = 0, e = 0, f = 0;
  int i = 0, j = 0;
  double d1 = 0, d2 = 0, d3 = 0, d4 = 0, d5 = 0, d6 = 0;
  int a1[256], a2[512], a3[1024];
  char s1[200000], s2[200000], s3[200000];
  
  cin >> a >> b;
  
  for(i = 0; i < a; i++){
    cin >> a1[i];
  }
  c++;
  for(i = 0; i < a; i++){
    if(b >= a1[i] + d){
      c++;
    }
    d += a[i];
  }  
  cout << c << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:43:11: error: invalid types 'int[int]' for array subscript
   43 |     d += a[i];
      |           ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
  int N,X;
  cin>> N >> X;
  int d = 0;
  int n = 1;
  
  vector<int> L(N+1);
  L.at(0) = -10000;
  
  vector<int> bnd(N+1);  //跳ねる座標
  bnd.at(0) = -10000;
  bnd.at(1) = 0;
  
  
  for(int i = 1;i<N+1;i++){
    cin >> L.at(i);
  }
  
  for(int i = 2;i<N+1;i++){
    d = (d) + (L.at(i-1));
    
    if(d<=X) n++;
     
  }
  cout n << endl; 
  
  
  
  
  
  
  
  
  
  
  
  
  
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:7: error: expected ';' before 'n'
   28 |   cout n << endl;
      |       ^~
      |       ;
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
 int N,X;
  int Sum = 0;
  cin >> N >> X;
  vecter<int> vec(N);
  for(int i=0; i<N; i++){
    cin >> vec.at(i);
    if(i+vec.at(i)-2 <= X){
     Sum=1+Sum;}
    cout << Sum << endl;    
  }   
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'vecter' was not declared in this scope
    8 |   vecter<int> vec(N);
      |   ^~~~~~
a.cc:8:10: error: expected primary-expression before 'int'
    8 |   vecter<int> vec(N);
      |          ^~~
a.cc:10:12: error: 'vec' was not declared in this scope
   10 |     cin >> vec.at(i);
      |            ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
 int N,X;
  int Sum = 0;
  cin >> N >> X;
  vecter<int> vec(L);
  for(int i=0; i<N; i++){
    cin >> vec.at(i);
    if(i+vec.at(i)-2 <= X){
     Sum=1+Sum;}
    cout << "Sum" << endl;    
  }   
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'vecter' was not declared in this scope
    8 |   vecter<int> vec(L);
      |   ^~~~~~
a.cc:8:10: error: expected primary-expression before 'int'
    8 |   vecter<int> vec(L);
      |          ^~~
a.cc:10:12: error: 'vec' was not declared in this scope
   10 |     cin >> vec.at(i);
      |            ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
 int N,X;
  int Sum = 0;
  cin >> N >> X;
  vecter<int> vec(L);
  for(int i=0; i<N; i++){
    if(i+vec.at(i)-2 <= X){
     Sum=1+Sum}
    cout << "Sum" << endl;    
  }   
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'vecter' was not declared in this scope
    8 |   vecter<int> vec(L);
      |   ^~~~~~
a.cc:8:10: error: expected primary-expression before 'int'
    8 |   vecter<int> vec(L);
      |          ^~~
a.cc:10:10: error: 'vec' was not declared in this scope
   10 |     if(i+vec.at(i)-2 <= X){
      |          ^~~
a.cc:11:15: error: expected ';' before '}' token
   11 |      Sum=1+Sum}
      |               ^
      |               ;
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
 int N;
 cin >> N;
 int X;
 cin >> X;
 int L;
 L = 0;
 int M;
 int K;
 K = 0;
 for (int i = 0; i < N; i++) {
   cin >> M;
   L =  L + M;
   if ( L =< X ) {
     K = K + 1;
     }
   }
 K = K + 1;
 cout << K << endl;
       

Compiler output:
a.cc: In function 'int main()':
a.cc:17:12: error: expected primary-expression before '<' token
   17 |    if ( L =< X ) {
      |            ^
a.cc:22:20: error: expected '}' at end of input
   22 |  cout << K << endl;
      |                    ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
 
int main() {
  int n,x;
  cin>>n>>x;
  
  vector<int> l(n); 
for (int i = 0; i < n; i++) {
cin >> l.at(i);
}
  //入力完了
  int ans=0;
  int sum;
  for(int i = 0; i < n-1; i++){
  sum += l.at(i);
   
    if (sum<=x){　　　//数える作業
    
    
    ans++;
    
  }
  }
  
  //Dを定義
  
  
  cout<<ans+1<<endl;
    
    

  return 0;
}

Compiler output:
a.cc:20:17: error: extended character 　 is not valid in an identifier
   20 |     if (sum<=x){　　　//数える作業
      |                 ^
a.cc:20:17: error: extended character 　 is not valid in an identifier
a.cc:20:17: error: extended character 　 is not valid in an identifier
a.cc: In function 'int main()':
a.cc:20:17: error: '\U00003000\U00003000\U00003000' was not declared in this scope
   20 |     if (sum<=x){　　　//数える作業
      |                 ^~~~~~
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
 
int main() {
  int n,x;
  cin>>n>>x;
  
  vector<int> l(n); 
for (int i = 0; i < n; i++) {
cin >> l.at(i);
}
  //入力完了
  
  int sum;
  for(int i = 0; i < n-1; i++){
  sum += l.at(i);
    int ans=0;
    if (sum<=x){　　　//数える作業
    
    
    ans++;
    
  }
  }
  
  //Dを定義
  
  
  cout<<ans+1<<endl;
    
    

  return 0;
}

Compiler output:
a.cc:20:17: error: extended character 　 is not valid in an identifier
   20 |     if (sum<=x){　　　//数える作業
      |                 ^
a.cc:20:17: error: extended character 　 is not valid in an identifier
a.cc:20:17: error: extended character 　 is not valid in an identifier
a.cc: In function 'int main()':
a.cc:20:17: error: '\U00003000\U00003000\U00003000' was not declared in this scope
   20 |     if (sum<=x){　　　//数える作業
      |                 ^~~~~~
a.cc:31:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   31 |   cout<<ans+1<<endl;
      |         ^~~
      |         abs
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
 
int main() {
  int n,x;
  cin>>n>>x;
  
  vector<int> l(n); 
for (int i = 0; i < n; i++) {
cin >> l.at(i);
}
  //入力完了
  
  int sum;
  for(int i = 0; i < n; i++){
  sum += l.at(i);
  }
  
  //Dを定義
  
  int ans=0;
  
  if (sum<=x){　　　//数える作業
    
    
    ans++;
    
  }
  
  cout<<ans+1<<endl;
    
    

  return 0;
}

Compiler output:
a.cc:25:15: error: extended character 　 is not valid in an identifier
   25 |   if (sum<=x){　　　//数える作業
      |               ^
a.cc:25:15: error: extended character 　 is not valid in an identifier
a.cc:25:15: error: extended character 　 is not valid in an identifier
a.cc: In function 'int main()':
a.cc:25:15: error: '\U00003000\U00003000\U00003000' was not declared in this scope
   25 |   if (sum<=x){　　　//数える作業
      |               ^~~~~~
Language: Java

import java.util.Scanner;

/**
 * @author author
 *
 */
public class BBounding {

  /**
   * @param args
   */
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = Integer.parseInt(sc.next());
    long x = Long.parseLong(sc.next());
    int d = 0;

    
    for (int i = 1; i <= n; i++) {
      d += Integer.parseInt(sc.next());
      if (d > x) {
        System.out.println(i);
        return;
      }
    }
  }

}


Compiler output:
Main.java:7: error: class BBounding is public, should be declared in a file named BBounding.java
public class BBounding {
       ^
1 error
Language: C++

include<stdio.h>
#include<stdlib.h>

int main(){
  int N,X,i,D;
  int *L;
  scanf("%d %d\n",&N,&X);
  L=(int *)malloc(sizeof(int)*(N+1));
  for(i=0;i<=N;i++){
    scanf("%d",&L[i]);
  }
  D=i=0;
  while(D<=X){
    D+=L[i++];
  }
  printf("%d",i);
  return 0;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<stdio.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:7:3: error: 'scanf' was not declared in this scope
    7 |   scanf("%d %d\n",&N,&X);
      |   ^~~~~
a.cc:16:3: error: 'printf' was not declared in this scope
   16 |   printf("%d",i);
      |   ^~~~~~
a.cc:3:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
    2 | #include<stdlib.h>
  +++ |+#include <cstdio>
    3 |
Language: C++

#include<stdio.h>
#include<stdlib.h>

int main(){
  int N,X,i,D;
  int *L;
  scanf("%d %d\n",&N,&X);
  L=malloc(sizeof(int)*N);
  for(i=0;i<N;i++){
    scanf("%d",&L[i]);
  }
  D=i=0;
  while(D<=X){
    D+=L[i++];
  }
  printf("%d",i);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:11: error: invalid conversion from 'void*' to 'int*' [-fpermissive]
    8 |   L=malloc(sizeof(int)*N);
      |     ~~~~~~^~~~~~~~~~~~~~~
      |           |
      |           void*
Language: C++

#include<stdio.h>

int main(){
  int N,X,i,D;
  int *L;
  scanf("%d %d\n",&N,&X);
  L=malloc(sizeof(int)*N);
  for(i=0;i<N;i++){
    scanf("%d",&L[i]);
  }
  D=i=0;
  while(D<=X){
    D+=L[i++];
  }
  printf("%d",i-1);
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: 'malloc' was not declared in this scope
    7 |   L=malloc(sizeof(int)*N);
      |     ^~~~~~
a.cc:2:1: note: 'malloc' is defined in header '<cstdlib>'; this is probably fixable by adding '#include <cstdlib>'
    1 | #include<stdio.h>
  +++ |+#include <cstdlib>
    2 |
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {

  int N, X; cin >> N >> X;
  int D = 0;
  for (int i = 0; i < N; i++) {
    int L; cin >> L;
    D += L;
    if (D > X) {
      break;
    }
  }
  cout << i << endl;
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:11: error: 'i' was not declared in this scope
   15 |   cout << i << endl;
      |           ^
Language: C++

#include <iostream>

int main()
{
    int N, X;
    std::cin >> N >> X;

    int L[1000];
    for (int i = 0; i < N; i++) {
        std::cin >> L[i];
    }

    int D = 0;
    int ans = 0;
    for (int i = 0; i < N; i++) {
        if (D > X) break;
        ans++;
        D += L[i];
    }

    std::cout << i << std::endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:18: error: 'i' was not declared in this scope
   21 |     std::cout << i << std::endl;
      |                  ^
Language: C++

#include<iostream>
using namespace std;
 
int main(){
  	unsigned int N,X;
	unsigned int SUM = 0;
 
	cin>>N;
  	cin>>X;
  
  	unsigned int L[N];
	for(int i = 1;i <= N; i++){
    	cin >> L[i];
    }
	for(int k = 1;k <= N; k++){
      	SUM += L[k]
          if(SUM > X){
          	cout << (k-1);
            break;
          }
    }
  	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:20: error: expected ';' before 'if'
   16 |         SUM += L[k]
      |                    ^
      |                    ;
   17 |           if(SUM > X){
      |           ~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  cin >> N;
  int X;
  cin >> X;
  
  vector<int> vec(N)
    for(int i=0; i<N; i++){
      cin >> vec.at(i);
    }
  
  int cnt=1;
  
  for(int i=0; i<N; i++){
    if(X>=i-1+vec.at(i-1))cnt++;
  }
  
  cout << cnt << endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: expected ',' or ';' before 'for'
   11 |     for(int i=0; i<N; i++){
      |     ^~~
a.cc:11:18: error: 'i' was not declared in this scope
   11 |     for(int i=0; i<N; i++){
      |                  ^
a.cc:21:23: error: expected '}' at end of input
   21 |   cout << cnt << endl;
      |                       ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: Java

import java.util.*;
 
public class Main {
  public static void main(String[] args) {
      Scanner sc = new Scanner(System.in);
      int N = Integer.parseInt(sc.next());
      int X = Integer.parseInt(sc.next());
      
      int i = 0;
      int D = 0;
      int bound=1;
      while(D <= X && i < N) {
          D = D + Integer.parseInt(sc.next());
          i++;
          if(D <= X)
          	bound+=1
      }

      System.out.println(bound);
 
      sc.close();
      
  }
}

Compiler output:
Main.java:16: error: ';' expected
          	bound+=1
          	        ^
1 error
Language: C++

#include <iostream>
#include <string>
#include <vector>

using namespace std;

int main()
{
	int N,X;
	cin >> N >> X;
	int D = 0, ans = 1;
	vector<int> L(N);
	for(int i = 0; i<N; i++){
		cin >> L.at(i);
		D += L.at(i);
		if(D <= X){
			ans++;
		}else{
			break
		}
	}
	cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:30: error: expected ';' before '}' token
   19 |                         break
      |                              ^
      |                              ;
   20 |                 }
      |                 ~
Language: C++

// a.cpp : メイン プロジェクト ファイルです。
#include <iostream>
#include <string>
#include <vector>

using namespace std;

int main()
{
	int N,X;
	cin >> N >> X;
	int D = 0, ans = 1;
	vector<int> L(N);
	for(int i = 0; i<N; i++){
		cin >> L.at(i);
		D += L.at(i);
		if(D <= X){
			ans++;
		}else{
			break
		}
	}
	cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:30: error: expected ';' before '}' token
   20 |                         break
      |                              ^
      |                              ;
   21 |                 }
      |                 ~
Language: C++

// a.cpp : メイン プロジェクト ファイルです。

#include "stdafx.h"
#include <iostream>
#include <string>
#include <vector>

using namespace std;

int main()
{
	int N,X; cin >> N >> X;
	vector<int> D(N + 1);
	D[0] = 0;
	for(int i = 0; i <= N; i++){
		int x; cin >> x;
		D[i+1] = D[i]+X;
	}
	int ans = 0;
	for(int i = 0; i <= N; i++){
		if(D[i] <= X) {
			ans++;
		}
	}
	cout << ans << endl;
}


Compiler output:
a.cc:3:10: fatal error: stdafx.h: No such file or directory
    3 | #include "stdafx.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
#include <iomanip>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int main() {
  int n,x; cin >>n >> x;
  vector<int> l(n);
  rep(i, n) {
    cin >>l.at(i);
  }
  int d =0;
  int ans =0;
  rep(i, n) {
    if (d <= x) {
      ans++;
      d = d + l.at(i)
    }
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:22: error: expected ';' before '}' token
   18 |       d = d + l.at(i)
      |                      ^
      |                      ;
   19 |     }
      |     ~
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main () {
        int n, x, c = 0, count = 0;

        cin >> n >> x;
        int arr[n];
        for (int i = 0; i < n; ++i) {
                cin >> arr[i];
                if (c <= x) {
                        count++;
                } else {
                        break;
                }

                c += arr[i];
        }

        cout << count << "\n";

}
~                                                                                                                  
~                                                                                                                  
~                                                                                                                  
~            

Compiler output:
a.cc:25:1: error: expected class-name before '~' token
   25 | ~
      | ^
Language: C++

#include <cstdlib>
#include <string>
#include <vector>
#include <stack>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <math.h>
#include <stdio.h>
#include <ctype.h>
#include <ios> 
#include <iomanip>
using namespace std;

#define N_MAX   (100000)
#define LL_MAX_NUM (1LL<<60)
#define INF 1e7

typedef long long ll;
typedef long long int lli;

int main() {
	int N, X, ans, loc; cin >> N >> X;
    loc = 0;
    ans = 1;
    for (int i = 0; i < N; i++)
    {
        int L; cin >> L;
        loc += L;
        if (loc <= X) ans++;
        else break;
    }
    cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:29: error: 'cin' was not declared in this scope
   24 |         int N, X, ans, loc; cin >> N >> X;
      |                             ^~~
a.cc:14:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
   13 | #include <iomanip>
  +++ |+#include <iostream>
   14 | using namespace std;
a.cc:34:5: error: 'cout' was not declared in this scope
   34 |     cout << ans << endl;
      |     ^~~~
a.cc:34:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
  int n,l;
  cin >> n >> l;
  vector <int> vec(n);
  for (int i = 0; i <n; i++){
  cin >> vec.at(i);
  }
  vector <int> vec2(n+1);
  vec2.at(0) == 0;
  for (int i = 1; i < n +1; i++){
  vec2.at(i) == vec2.at(i-1) + vec.at(i-1);
  }
  int count = 0;
  for (int i = 0; i <n+1; i++){
  if(vec2.(i) <= l){
  count += 1;
  }
  }
  cout << count;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:11: error: expected unqualified-id before '(' token
   18 |   if(vec2.(i) <= l){
      |           ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
  int n,l;
  cin >> n >> l;
  vector <int> vec(n);
  for (int i = 0; i <n; i++){
  cin >> vec.at(i);
  }
  int L;
  int count = 0;
  for (int i = 0; i < n; i++){
  if(L <=X){
  L += vec.at(i);
    count +=1;
  }else{
  }
  }
  cout << count -1;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:10: error: 'X' was not declared in this scope
   14 |   if(L <=X){
      |          ^
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int main() {
    int N, X;
    cin >> N >> X;
    vector<int> temp(N)
    for(int i = 0; i < N; i++)
        cin >> temp[i];
    
    int count = 0;
    int coor = 0;
    for(int i = 0; i < N; i++) {
        coor += temp[i];
        if(coor >= X)
            count++;
    }

    cout << 1 + count << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: expected ',' or ';' before 'for'
   10 |     for(int i = 0; i < N; i++)
      |     ^~~
a.cc:10:20: error: 'i' was not declared in this scope
   10 |     for(int i = 0; i < N; i++)
      |                    ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
	int N, X;
	cin >> N >> X;
	vector<int> L(N);
	for(int i = 0; i < N; i++){
		cin >> L.at(i);
	}
	
	int now = 0:
	int jump = 0;
	while(now < X){
		now += L[jump];
		jump++;
	}
	cout << jump << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:20: error: expected ',' or ';' before ':' token
   12 |         int now = 0:
      |                    ^
a.cc:15:26: error: 'jump' was not declared in this scope
   15 |                 now += L[jump];
      |                          ^~~~
a.cc:18:17: error: 'jump' was not declared in this scope
   18 |         cout << jump << endl;
      |                 ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
	int N, X;
	cin >> N >> X;
	vector<int> L(N);
	for(int i = 0; i < N; i++){
		cin >> L.at(i);
	}
	
	int now = 0;
	int jump = 0;
	while(now < X){
		jump++;
		now += L[i];
	}
	cout << jump << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:26: error: 'i' was not declared in this scope
   16 |                 now += L[i];
      |                          ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
	int N, X;
	cin >> N >> X;
	vector<int> L(N);
	for(int i = 0; i < N; i++){
		cin >> L.at(i);
	}
	
	int now = 0:
	int jump = 0;
	while(now < X){
		jump++;
		now += L[i];
	}
	cout << jump << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:20: error: expected ',' or ';' before ':' token
   12 |         int now = 0:
      |                    ^
a.cc:15:17: error: 'jump' was not declared in this scope
   15 |                 jump++;
      |                 ^~~~
a.cc:16:26: error: 'i' was not declared in this scope
   16 |                 now += L[i];
      |                          ^
a.cc:18:17: error: 'jump' was not declared in this scope
   18 |         cout << jump << endl;
      |                 ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  int n, x, r = 0, c = 1;
  cin >> n >> x;
  if(int i = 0; i < n; i++){
    int p;
    cin >> p;
    r += p;
    if(r <= x)
      c++;
  }
  cout << c << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:22: error: expected ')' before ';' token
    7 |   if(int i = 0; i < n; i++){
      |     ~                ^
      |                      )
a.cc:7:24: error: 'i' was not declared in this scope
    7 |   if(int i = 0; i < n; i++){
      |                        ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
int n,x; int i=0; int xxx=0;
cin >> n >> x;
int l[n]
while(i<n){
    cin >> l[i++]; 
}

i=0;
while(xxx<=x){
    i++;
if(i<=n){
xxx += l[i-1];
}
}
cout << i << endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:1: error: expected initializer before 'while'
    8 | while(i<n){
      | ^~~~~
a.cc:16:8: error: 'l' was not declared in this scope
   16 | xxx += l[i-1];
      |        ^
Language: Java

import java.util.*;

public class Main{
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int x = sc.nextInt();
        int[] l = new int[n];
        int[] d = new int[n+1];
        d[0] = 0;
        for(int i = 0; i < n; i++){
            l[i] = sc.nextInt();
        }
        int count = 1;
        for(int i = 1; i < N+1; i++){
            d[i] = d[i-1] + l[i-1];
            if (d[i] <= x)
                count++;
        }
        System.out.println(count);
        sc.close();  
    }
}

Compiler output:
Main.java:16: error: cannot find symbol
        for(int i = 1; i < N+1; i++){
                           ^
  symbol:   variable N
  location: class Main
1 error
Language: C++

#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;

int main(){
	int N, X;
	cin >> N >> X;
	vector<int> L(N);
	for(int i = 0; i < N; i++) cin >> L.at(i);
	
	int count = 0;
	int now = 0;
	
	while(now < X){
		count++;
		now += L.at(i);
	}
	
	cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:29: error: 'i' was not declared in this scope
   16 |                 now += L.at(i);
      |                             ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int N, X;
  cin >> N >> X;
  vector<int> L(N);
  for (auto &i:L) cin >> i;
  int ans = 1;
  int cnt = 0;
  for (int i = 0; i < N; i++){
    cnt += L[i];
    if (cnt > X)
      break;
    ans++;
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:2: error: expected '}' at end of input
   17 | }
      |  ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<n ; i++)

int main(){
  int N,X;
  cin >> N >> X;
  
  vector<int> L(N);
  
  rep(i,N) cin >> L[i];
  
  int ans = 1;
  int len = 0;
  rep(i,N){
    len += L[i];
    if(len >= X) break;
    ans++;
  }
  
  cout << ans << endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:21:23: error: expected '}' at end of input
   21 |   cout << ans << endl;
      |                       ^
a.cc:5:11: note: to match this '{'
    5 | int main(){
      |           ^
Language: C++

#include<bits/stdc++.h>
using namespace std;

int main() {
	int N, X;
	cin >> N >> X;
	vector<int>D(N+1);
	D[0]=0

	for (int i = 0;i < N;++i) {
		int x;
		cin >> x;
		D[i + 1] = D[i] + x;
	}
	int ans = 0;
	for (int i = 0;i <= N;++i) {
		if (X >= D[i]) { ans++;
		}
	}
	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:15: error: expected ';' before 'for'
    8 |         D[0]=0
      |               ^
      |               ;
    9 | 
   10 |         for (int i = 0;i < N;++i) {
      |         ~~~    
a.cc:10:24: error: 'i' was not declared in this scope
   10 |         for (int i = 0;i < N;++i) {
      |                        ^
Language: C++

#include<bits/stdc++.h>
using namespace std;

int main() {
	int N, X;
	cin >> N >> X;
	vector<int>D(N+1);
	D[0]=0

	for (int i = 0;i < N;++i) {
		int x;
		cin >> x;
		D[i + 1] = D[i] + x;
	}
	int ans = 0;
	for (int i = 0;i <= N;++i) {
		if (X >= D[i]) { ++ans;
		}
	}
	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:15: error: expected ';' before 'for'
    8 |         D[0]=0
      |               ^
      |               ;
    9 | 
   10 |         for (int i = 0;i < N;++i) {
      |         ~~~    
a.cc:10:24: error: 'i' was not declared in this scope
   10 |         for (int i = 0;i < N;++i) {
      |                        ^
Language: C++

#include<bits/stdc++.h>
using namespace std;

int main() {
	int n, x;
	cin >> n >> x;
	vector<int>L(n+1);
	int L[0] = 0;
	int ans = 0;
	
	for (int i = 0;i < n;i++) {
		int X;
		cin >> X;
		L[i+1] = L[i] + X;
	}
		for (int i = 0;i < n;i++) {
			if (x >= L[i])++ans;
		}
		
	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:13: error: conflicting declaration 'int L [0]'
    8 |         int L[0] = 0;
      |             ^
a.cc:7:20: note: previous declaration as 'std::vector<int> L'
    7 |         vector<int>L(n+1);
      |                    ^
Language: C++

#include<bits/stdc++.h>
using namespace std;

int main() {
	int n, x;
	cin >> n >> x;
	vector<int>L(n);
	for (int i = 1;i <= n;i++)cin >> L[i];
	int ans = 1;
	int D = 0;
	
	while(true){
		bool Long = false;
		for (int i = 1;i <= n;i++) {
			D += L[i];
		}
		for (int i = 1;i <= n;i++){
			if (D >> x)Long = true;
		}
		if (Long)break;

		for (int i = 1;i <= n;i++) {
			D += L[i];
		}
		++ans
	}
	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:22: error: expected ';' before '}' token
   25 |                 ++ans
      |                      ^
      |                      ;
   26 |         }
      |         ~
Language: C++

#include<bits/stdc++.h>
using namespace std;

int main() {
	int n, x;
	cin >> n >> x;
	vector<int>L(n);
	for (int i = 1;i <= n;i++)cin >> L[i];
	int ans = 1;
	int D = 0;
	
	while(true){
		bool Long = false;
		for (int i = 1;i <= n;i++) {
			D += L[i];
			if (D >> x)Long = true;
		}
		if (Long)break;

		for (int i = 1;i <= n;i++) {
			D += L[i];
		}
		++ans
	}
	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:22: error: expected ';' before '}' token
   23 |                 ++ans
      |                      ^
      |                      ;
   24 |         }
      |         ~
Language: C

#include<stdio.h>

int main(void)
{
   int n,x,i,a[100],s,t;

   scanf("%d %d",&n,&x);

   for(i=0;i<n;i++){
      scanf("%d",&a[i]);
   }

   s=0;
   i=0;
   while(s<=x){
     s=s+a[i];
     i++;
   }

   printf("%d\n",i);

   return 0;


Compiler output:
main.c: In function 'main':
main.c:22:4: error: expected declaration or statement at end of input
   22 |    return 0;
      |    ^~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;

int main(){
  int N,X;
  int ans=0;
  cin >> N >> X;
  vector<int> L(N);
  for(int i=0;i<N;i++) cin >> L(i);
  int d=0;
  for(int i=0;d<=X;i++,ans++){
    d+=d+L(i);
  }
  cout << ans+1 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:32: error: no match for call to '(std::vector<int>) (int&)'
    9 |   for(int i=0;i<N;i++) cin >> L(i);
      |                               ~^~~
a.cc:12:11: error: no match for call to '(std::vector<int>) (int&)'
   12 |     d+=d+L(i);
      |          ~^~~
Language: Java

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

/**
 * AtCoder Beginner Contest 130<br>
 * B - Bounding<br>
 * https://atcoder.jp/contests/abc130/tasks/abc130_b<br>
 */
public class ABC130B {

    public static void main(String[] args) {

        String[] input1;
        String[] input2;

        try (Scanner sc = new Scanner(System.in)) {
            input1 = sc.nextLine().split(" ");
            input2 = sc.nextLine().split(" ");

            int N = Integer.parseInt(input1[0]);
            int X = Integer.parseInt(input1[1]);

            List<Integer> list = new ArrayList<Integer>();
            for (String str : input2) {
                list.add(Integer.parseInt(str));
            }
            // 計算
            int result = calc(N, X, list);

            // 出力
            System.out.println(result);
        } 
    }

    private static int calc(int N, int X, List<Integer> list) {
        int ans = 0;
        int count = 1;
        for (int i = 0; i <= N; i++) {
            ans = ans + list.get(i);
            if (X < ans) {
                break;
            }
            count++;
        }
        return count;
    }
}

Compiler output:
Main.java:10: error: class ABC130B is public, should be declared in a file named ABC130B.java
public class ABC130B {
       ^
1 error
Language: Java

import java.util.*;

public class Lession2 {

    public static void main(String[] args) {

        Scanner parameter = new Scanner(System.in);

        Integer count = 1;

        String[] input1 = parameter.nextLine().split(" ");
        String[] input2 = parameter.nextLine().split(" ");

        String limit = input1[1];

        Integer total = 0;

        for (int i = 0; i < input2.length; i++) {

        	total = total + Integer.valueOf(input2[i]);

        	if (total < Integer.valueOf(limit)) {

        		count = count + 1;
        	} else {

        		break;
        	}
        }

        System.out.println(count);
    }
}


Compiler output:
Main.java:3: error: class Lession2 is public, should be declared in a file named Lession2.java
public class Lession2 {
       ^
1 error
Language: Java

import java.util.Scanner;

public class Main{
  public static void main(String[] args){
   Scaneer sc = new Scanner(System.in);
    int n = sc.nextInt();
    int x = sc.nextInt();
    
    int[] l = new int[n];
    int bound = 0;
    int count = 1;
    
    for(int i =0; i < n; i++){
      bound += sc.nextInt();
      
      if(bound < x){
        break;
     }    
    count++;
    }
    System.out.println(count);
  }
 }

Compiler output:
Main.java:5: error: cannot find symbol
   Scaneer sc = new Scanner(System.in);
   ^
  symbol:   class Scaneer
  location: class Main
1 error
Language: C++

#include<iostream>
using namespace std;
int main()
{
    int n, x;
    cin >> n;
    
    int count = 1;
    int d = 0;
    int l;
    for (int i = 0; i < n; i++) {
      cin >> l;
      d += l;
      if (d <= x) count++
    }
    cout << count << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:26: error: expected ';' before '}' token
   14 |       if (d <= x) count++
      |                          ^
      |                          ;
   15 |     }
      |     ~
Language: Java

import java.util.Scanner;

public class Main{
  public static void main(String[] args){
   Scaneer sc = new Scanner(System.in);
    int n = sc.nextInt();
    int x = sc.nextInt();
    
    int[] l = new int[n];
    int bound = 0;
    int count = 1;
    
    for(int i =0; i < n; i++){
      bound += sc.nextInt();
      count++;
      if(bound < x){
        break;
     }    
    }
    System.out.println(count);
  }
 }

Compiler output:
Main.java:5: error: cannot find symbol
   Scaneer sc = new Scanner(System.in);
   ^
  symbol:   class Scaneer
  location: class Main
1 error
Language: Java

import java.util.*;

public class Main{
  public static void main(String[] args){
   Scaneer sc = new Scanner(System.in);
    int n = sc.nextInt();
    int x = sc.nextInt();
    
    int[] l = new int[n];
    int bound = 0;
    int count = 1;
    
    for(int i =0; i < n; i++){
      bound += sc.nextInt();
      count++;
      if(bound < x){
        break;
     }    
    }
    System.out.println(count);
  }
 }

Compiler output:
Main.java:5: error: cannot find symbol
   Scaneer sc = new Scanner(System.in);
   ^
  symbol:   class Scaneer
  location: class Main
1 error
Language: Java

import java.util.*;

public class Main{
  public static void main(String[] args){
   Scaneer sc = new Scanner(Syst0em.in);
    int n = sc.nextInt();
    int x = sc.nextInt();
    
    int[] l = new int[n];
    int bound = 0;
    int count = 1;
    
    for(int i =0; i < n; i++){
      bound += sc.nextInt();
      count++;
      if(bound < x){
        break;
     }    
    }
    System.out.printlm(count);
  }
 }

Compiler output:
Main.java:5: error: cannot find symbol
   Scaneer sc = new Scanner(Syst0em.in);
   ^
  symbol:   class Scaneer
  location: class Main
Main.java:5: error: cannot find symbol
   Scaneer sc = new Scanner(Syst0em.in);
                            ^
  symbol:   variable Syst0em
  location: class Main
Main.java:20: error: cannot find symbol
    System.out.printlm(count);
              ^
  symbol:   method printlm(int)
  location: variable out of type PrintStream
3 errors
Language: Java

import java.util.*;

public class Main{
  public static void main(String[] args){
   Scaneer sc = new Scanner(Syst0em.in);
    int n = sc.nextInt();
    int x = sc.nextInt();
    
    int[] l = new int[n];
    int bound = 0;
    int count = 1;
    
    for(int i =0; int i < n; i++){
      bound += sc.nextInt();
      count++;
      if(bound < x){
        break;
     }    
    }
    System.out.printlm(count);
  }
 }

Compiler output:
Main.java:13: error: '.class' expected
    for(int i =0; int i < n; i++){
                      ^
Main.java:13: error: not a statement
    for(int i =0; int i < n; i++){
                        ^
Main.java:13: error: ')' expected
    for(int i =0; int i < n; i++){
                           ^
Main.java:13: error: ';' expected
    for(int i =0; int i < n; i++){
                                ^
4 errors
Language: Java

import java.util.*;

public class Main{
  public static void main(String[] args){
   Scaneer sc = new Scanner(Syst0em.in);
    int n = sc.nextInt();
    int x = sc.nextInt();
    
    int[] l = new int[n];
    int bound = 0;
    int count = 1;
    
    for(int i =0;int i < n;i++){
      bound += sc.nextInt();
      count++;
      if(bound < x){
        break;
     }    
    }
    System.out.printlm(count);
  }
 }

Compiler output:
Main.java:13: error: '.class' expected
    for(int i =0;int i < n;i++){
                     ^
Main.java:13: error: not a statement
    for(int i =0;int i < n;i++){
                       ^
Main.java:13: error: ')' expected
    for(int i =0;int i < n;i++){
                          ^
Main.java:13: error: ';' expected
    for(int i =0;int i < n;i++){
                              ^
4 errors
Language: Java

import java.util*;

public class Main{
  public static void main(String[] args){
   Scaneer sc = new Scanner(Syst0em.in);
    int n = sc.nextInt();
    int x = sc.nextInt();
    
    int[] l = new int[n];
    int bound = 0;
    int count = 1;
    
    for(int i =0,int i < n,i++){
      bound += sc.nextInt();
      count++;
      if(bound < x){
        break;
     }    
    }
    System.out.printlm(count);
  }
 }

Compiler output:
Main.java:1: error: ';' expected
import java.util*;
                ^
Main.java:13: error: <identifier> expected
    for(int i =0,int i < n,i++){
                 ^
Main.java:13: error: '.class' expected
    for(int i =0,int i < n,i++){
                     ^
Main.java:13: error: not a statement
    for(int i =0,int i < n,i++){
                       ^
4 errors
Language: C++

//Author: Mohammad Faisal
#include<bits/stdc++.h>
using namespace std;
int main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n,k;
  cin >> n >> k;
  int * arr = new int [n+1];
  int arr[0] = 0;
  int count=0;
  if(arr[0]<=k)
    count++;
  for(int i=1;i<=n;i++)
  {
    int x;
    cin >> x;
    arr[i] = arr[i-1] + x;
    if(arr[i]<=k)
      count++;
  }
  cout<<count<<endl;
  return 0;
  }
  
  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:12:7: error: conflicting declaration 'int arr [0]'
   12 |   int arr[0] = 0;
      |       ^~~
a.cc:11:9: note: previous declaration as 'int* arr'
   11 |   int * arr = new int [n+1];
      |         ^~~
Language: C++

#include<iostream>
using namespace std;
int main() {
  int N,X,i,now=0;
  cin >> N >> X;
  vector<int> L(N);
  for(i=0;i<N;i++)cin >> L[i];
  for(i=0;i<N;i++){
    now += L[i];
    if(now > X) {
      cout << i+1 << endl;
      return 0;
    }
  }
  cout << N+1 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'vector' was not declared in this scope
    6 |   vector<int> L(N);
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include<iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:6:10: error: expected primary-expression before 'int'
    6 |   vector<int> L(N);
      |          ^~~
a.cc:7:26: error: 'L' was not declared in this scope
    7 |   for(i=0;i<N;i++)cin >> L[i];
      |                          ^
a.cc:9:12: error: 'L' was not declared in this scope
    9 |     now += L[i];
      |            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;


// ABC130B - Bounding
// https://atcoder.jp/contests/abc130/tasks/abc130_b
void ABC130B() {

	/*
	  ※初見の感想※
	  ・普通に計算するだけで解けそう
	  　→ 自分で計算してみると何故か上手くいかない
	    → 漸化式の問題は素直に全ての値を計算した後に判定した方が良さそう
	*/
	

	int N, X;
	cin >> N >> X;

	vector<int> L(N);
	vector<int> D(N+1);
	D[0] = 0;
	for (int i = 0; i < N; i++)
	{
		cin >> L[i];
		D[i + 1] = D[i] + L[i];
	}

	int ans = 0;
	for (int i = 0; i <= N; i++)
	{
		if (D[i] <= X) {
			ans++;
		}
	}
	cout << ans << endl;



	/*
	int d = 0; //座標の初期値
	for (int i = 2;i <= N+1; i++)
	{
		//i回目に跳ねる座標を計算
		d += L[i - 1];

		//跳ねた座標が座標Xを超えていたら終了
		if (d > X) {
			cout << i << endl;
			return;
		}
	}
	*/
}

Compiler output:
/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
Language: C++

#include <bits/stdc++.h>
using namespace std;


// ABC130B - Bounding
// https://atcoder.jp/contests/abc130/tasks/abc130_b
void ABC130B() {

	/*
	  ※初見の感想※
	  ・普通に計算するだけで解けそう
	  　→ 自分で計算してみると何故か上手くいかない
	    → 漸化式の問題は素直に全ての値を計算した後に判定した方が良さそう
	*/
	

	int N, X;
	cin >> N >> X;

	vector<int> L(N);
	vector<int> D(N+1);
	D[0] = 0;
	for (int i = 0; i < N; i++)
	{
		cin >> L[i];
		D[i + 1] = D[i] + L[i];
	}

	int ans = 0;
	for (int i = 0; i < N; i++)
	{
		if (D[i] <= X) {
			ans++;
		}
	}
	cout << ans << endl;



	/*
	int d = 0; //座標の初期値
	for (int i = 2;i <= N+1; i++)
	{
		//i回目に跳ねる座標を計算
		d += L[i - 1];

		//跳ねた座標が座標Xを超えていたら終了
		if (d > X) {
			cout << i << endl;
			return;
		}
	}
	*/
}

Compiler output:
/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
Language: C++

    #include<stdio.h>
     
    int main(void){
        int N, X;
        int L[N];
        int D[100];
        D[0] = 0;
        int j = 0;
        if(scanf("%d %d" ,&N, &X) < 1){
            fprintf(stderr, "error: ill-formed fraction.\n");
        }
        for(int i=0; i<N; i++){
            if(scanf("%d",&L[i]) < 1){
                fprintf(stderr, "error: ill-formed fraction.\n");
            }else{
                D[i+1] = D[i] + L[i];
        }
        for(i=0; I<=N; i++)
            if(D[i] <= X){
                j++;
            }
        }
        printf("%d\n",j);
        return 0;
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:18:18: error: 'I' was not declared in this scope
   18 |         for(i=0; I<=N; i++)
      |                  ^