Language: C++

#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <fstream>
#include<cstdio>
#include<iomanip>

#define REP(i, n) for(int i=0;i<n;i++)
#define REP2(i, s, n) for(int i=s;i<n;i++)
#define REP_1(i, n) for(int i=1;i<n+1;i++)
#define bitSearch(bit, n) for(int bit = 0; bit < (1 << N); bit++)
using namespace std;

void printAns(int a) { cout << a << endl; }

void yesno(bool a) { if (a)cout << "Yes" << endl; else cout << "No" << endl; }

void YESNO(bool a) { if (a)cout << "YES" << endl; else cout << "NO" << endl; }

typedef long long ll;
typedef unsigned long ul;
typedef long double ld;

template<class T>
inline bool chmin(T &a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}

template<class T>
inline bool chmax(T &a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

ll INF = 10000000;
ll mod = 1000000007;//10^9+7



//番号ズレ注意！！
int main() {
    int N, X, L[110];
    cin >> N >> X;
    int D[110] = {0};
    int ans;
    REP(i, N) {
        cin >> L[i];
        D[i + 1] = D[i] + L[i];
        if (D[i] <= X) { ans += 1; }
        else { break; }
    }
    cout << ans << endl;
}#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <fstream>
#include<cstdio>
#include<iomanip>

#define REP(i, n) for(int i=0;i<n;i++)
#define REP2(i, s, n) for(int i=s;i<n;i++)
#define REP_1(i, n) for(int i=1;i<n+1;i++)
#define bitSearch(bit, n) for(int bit = 0; bit < (1 << N); bit++)
using namespace std;

void printAns(int a) { cout << a << endl; }

void yesno(bool a) { if (a)cout << "Yes" << endl; else cout << "No" << endl; }

void YESNO(bool a) { if (a)cout << "YES" << endl; else cout << "NO" << endl; }

typedef long long ll;
typedef unsigned long ul;
typedef long double ld;

template<class T>
inline bool chmin(T &a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}

template<class T>
inline bool chmax(T &a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

ll INF = 10000000;
ll mod = 1000000007;//10^9+7



//番号ズレ注意！！
int main() {
    int N, X, L[110];
    cin >> N >> X;
    int D[110] = {0};
    int ans=0;
    REP(i, N) {
        cin >> L[i];
        D[i + 1] = D[i] + L[i];
        if (D[i] <= X) { ans += 1; }
        else { break; }
    }
    cout << ans << endl;
}

Compiler output:
a.cc:61:2: error: stray '#' in program
   61 | }#include <iostream>
      |  ^
a.cc:61:3: error: 'include' does not name a type
   61 | }#include <iostream>
      |   ^~~~~~~
a.cc:75:6: error: redefinition of 'void printAns(int)'
   75 | void printAns(int a) { cout << a << endl; }
      |      ^~~~~~~~
a.cc:15:6: note: 'void printAns(int)' previously defined here
   15 | void printAns(int a) { cout << a << endl; }
      |      ^~~~~~~~
a.cc:77:6: error: redefinition of 'void yesno(bool)'
   77 | void yesno(bool a) { if (a)cout << "Yes" << endl; else cout << "No" << endl; }
      |      ^~~~~
a.cc:17:6: note: 'void yesno(bool)' previously defined here
   17 | void yesno(bool a) { if (a)cout << "Yes" << endl; else cout << "No" << endl; }
      |      ^~~~~
a.cc:79:6: error: redefinition of 'void YESNO(bool)'
   79 | void YESNO(bool a) { if (a)cout << "YES" << endl; else cout << "NO" << endl; }
      |      ^~~~~
a.cc:19:6: note: 'void YESNO(bool)' previously defined here
   19 | void YESNO(bool a) { if (a)cout << "YES" << endl; else cout << "NO" << endl; }
      |      ^~~~~
a.cc:86:13: error: redefinition of 'template<class T> bool chmin(T&, T)'
   86 | inline bool chmin(T &a, T b) {
      |             ^~~~~
a.cc:26:13: note: 'template<class T> bool chmin(T&, T)' previously declared here
   26 | inline bool chmin(T &a, T b) {
      |             ^~~~~
a.cc:95:13: error: redefinition of 'template<class T> bool chmax(T&, T)'
   95 | inline bool chmax(T &a, T b) {
      |             ^~~~~
a.cc:35:13: note: 'template<class T> bool chmax(T&, T)' previously declared here
   35 | inline bool chmax(T &a, T b) {
      |             ^~~~~
a.cc:103:4: error: redefinition of 'll INF'
  103 | ll INF = 10000000;
      |    ^~~
a.cc:43:4: note: 'll INF' previously defined here
   43 | ll INF = 10000000;
      |    ^~~
a.cc:104:4: error: redefinition of 'll mod'
  104 | ll mod = 1000000007;//10^9+7
      |    ^~~
a.cc:44:4: note: 'll mod' previously defined here
   44 | ll mod = 1000000007;//10^9+7
      |    ^~~
a.cc:109:5: error: redefinition of 'int main()'
  109 | int main() {
      |     ^~~~
a.cc:49:5: note: 'int main()' previously defined here
   49 | int main() {
      |     ^~~~