Language: C++

#include<stdio.h>

??
int a[100000];
int main(void){
????int n, s;
????scanf("%d%d", &n, &s);
????for(int i = 0;i < n;++i)scanf("%d", &a[i]);
????int res = n + 1, sum = 0, l = 0, r = 0;
????for(;l < n;){
????????if(l == r)sum = a[r++];
????????else{
????????????if(sum >= s)sum -= a[l++];
????????????else if(r < n)sum += a[r++];
????????????else break;
????????}
????????if(sum >= s && res > r - l)res = r - l;
????}
????if(res <= n)printf("%d\n", res);
????else puts("0");
??
????return 0;
}

Compiler output:
a.cc:3:1: error: expected unqualified-id before '?' token
    3 | ??
      | ^
a.cc: In function 'int main()':
a.cc:6:1: error: expected primary-expression before '?' token
    6 | ????int n, s;
      | ^
a.cc:6:2: error: expected primary-expression before '?' token
    6 | ????int n, s;
      |  ^
a.cc:6:3: error: expected primary-expression before '?' token
    6 | ????int n, s;
      |   ^
a.cc:6:4: error: expected primary-expression before '?' token
    6 | ????int n, s;
      |    ^
a.cc:6:5: error: expected primary-expression before 'int'
    6 | ????int n, s;
      |     ^~~
a.cc:6:5: error: expected ':' before 'int'
    6 | ????int n, s;
      |     ^~~
      |     :
a.cc:6:5: error: expected primary-expression before 'int'
    6 | ????int n, s;
      |     ^~~
a.cc:6:5: error: expected ':' before 'int'
    6 | ????int n, s;
      |     ^~~
      |     :
a.cc:6:5: error: expected primary-expression before 'int'
    6 | ????int n, s;
      |     ^~~
a.cc:6:5: error: expected ':' before 'int'
    6 | ????int n, s;
      |     ^~~
      |     :
a.cc:6:5: error: expected primary-expression before 'int'
    6 | ????int n, s;
      |     ^~~
a.cc:6:5: error: expected ':' before 'int'
    6 | ????int n, s;
      |     ^~~
      |     :
a.cc:6:5: error: expected primary-expression before 'int'
    6 | ????int n, s;
      |     ^~~
a.cc:7:1: error: expected primary-expression before '?' token
    7 | ????scanf("%d%d", &n, &s);
      | ^
a.cc:7:2: error: expected primary-expression before '?' token
    7 | ????scanf("%d%d", &n, &s);
      |  ^
a.cc:7:3: error: expected primary-expression before '?' token
    7 | ????scanf("%d%d", &n, &s);
      |   ^
a.cc:7:4: error: expected primary-expression before '?' token
    7 | ????scanf("%d%d", &n, &s);
      |    ^
a.cc:7:20: error: 'n' was not declared in this scope
    7 | ????scanf("%d%d", &n, &s);
      |                    ^
a.cc:7:24: error: 's' was not declared in this scope
    7 | ????scanf("%d%d", &n, &s);
      |                        ^
a.cc:7:26: error: expected ':' before ';' token
    7 | ????scanf("%d%d", &n, &s);
      |                          ^
      |                          :
a.cc:7:26: error: expected primary-expression before ';' token
a.cc:7:26: error: expected ':' before ';' token
    7 | ????scanf("%d%d", &n, &s);
      |                          ^
      |                          :
a.cc:7:26: error: expected primary-expression before ';' token
a.cc:7:26: error: expected ':' before ';' token
    7 | ????scanf("%d%d", &n, &s);
      |                          ^
      |                          :
a.cc:7:26: error: expected primary-expression before ';' token
a.cc:7:26: error: expected ':' before ';' token
    7 | ????scanf("%d%d", &n, &s);
      |                          ^
      |                          :
a.cc:7:26: error: expected primary-expression before ';' token
a.cc:8:1: error: expected primary-expression before '?' token
    8 | ????for(int i = 0;i < n;++i)scanf("%d", &a[i]);
      | ^
a.cc:8:2: error: expected primary-expression before '?' token
    8 | ????for(int i = 0;i < n;++i)scanf("%d", &a[i]);
      |  ^
a.cc:8:3: error: expected primary-expression before '?' token
    8 | ????for(int i = 0;i < n;++i)scanf("%d", &a[i]);
      |   ^
a.cc:8:4: error: expected primary-expression before '?' token
    8 | ????for(int i = 0;i < n;++i)scanf("%d", &a[i]);
      |    ^
a.cc:8:5: error: expected primary-expression before 'for'
    8 | ????for(int i = 0;i < n;++i)scanf("%d", &a[i]);
      |     ^~~
a.cc:8:5: error: expected ':' before 'for'
    8 | ????for(int i = 0;i < n;++i)scanf("%d", &a[i]);
      |     ^~~
      |     :
a.cc:8:5: error: expected primary-expression before 'for'
    8 | ????for(int i = 0;i < n;++i)scanf("%d", &a[i]);
      |     ^~~
a.cc:8:5: error: expected ':' before 'for'
    8 | ????for(int i = 0;i < n;++i)scanf("%d", &a[i]);
      |     ^~~
      |     :
a.cc:8:5: error: expected primary-expression before 'for'
    8 | ????for(int i = 0;i < n;++i)scanf("%d", &a[i]);
      |     ^~~
a.cc:8:5: error: expected ':' before 'for'
    8 | ????for(int i = 0;i < n;++i)scanf("%d", &a[i]);
      |     ^~~
      |     :
a.cc:8:5: error: expected primary-expression before 'for'
    8 | ????for(int i = 0;i < n;++i)scanf("%d", &a[i]);
      |     ^~~
a.cc:8:5: error: expected ':' before 'for'
    8 | ????for(int i = 0;i < n;++i)scanf("%d", &a[i]);
      |     ^~~
      |     :
a.cc:8:5: error: expected primary-expression before 'for'
    8 | ????for(int i = 0;i < n;++i)scanf("%d", &a[i]);
      |     ^~~
a.cc:8:19: error: 'i' was not declared in this scope
    8 | ????for(int i = 0;i < n;++i)scanf("%d", &a[i]);
      |                   ^
a.cc:9:1: error: expected primary-expression before '?' token
    9 | ????int res = n + 1, sum = 0, l = 0, r = 0;
      | ^
a.cc:9:2: error: expected primary-expression before '?' token
    9 | ????int res = n + 1, sum = 0, l = 0, r = 0;
      |  ^
a.cc:9:3: error: expected primary-expression before '?' token
    9 | ????int res = n + 1, sum = 0, l = 0, r = 0;
      |   ^
a.cc:9:4: error: expected primary-expression before '?' token
    9 | ????int res = n + 1, sum = 0, l = 0, r = 0;
      |    ^
a.cc:9:5: error: expected primary-expression before 'int'
    9 | ????int res = n + 1, sum = 0, l = 0, r = 0;
      |     ^~~
a.cc:9:5: error: expected ':' before 'int'
    9 | ????int res = n + 1, sum = 0, l = 0, r = 0;
      |     ^~~
      |     :
a.cc:9:5: error: expected primary-expression before 'int'
    9 | ????int res = n + 1, sum = 0, l = 0, r = 0;
      |     ^~~
a.cc:9:5: error: expected ':' before 'int'
    9 | ????int res = n + 1, sum = 0, l = 0, r = 0;
      |     ^~~
      |     :
a.cc:9:5: error: expected primary-expression before 'int'
    9 | ????int res = n + 1, sum = 0, l = 0, r = 0;
      |     ^~~
a.cc:9:5: error: expected ':' before 'int'
    9 | ????int res = n + 1, sum = 0, l = 0, r = 0;
      |     ^~~
      |     :
a.cc:9:5: error: expected primary-expression before 'int'
    9 | ????int res = n + 1, sum = 0, l = 0, r = 0;
      |     ^~~
a.cc:9:5: error: expected ':' before 'int'
    9 | ????int res = n + 1, sum = 0, l = 0, r = 0;
      |     ^~~
      |     :
a.cc:9:5: error: expected primary-expression before 'int'
    9 | ????int res = n + 1, sum = 0, l = 0, r = 0;
      |     ^~~
a.cc:10:1: error: expected primary-expression before '?' token
   10 | ????for(;l < n;){
      | ^
a.cc:10:2: error: expected primary-expression before '?' token
   10 | ????for(;l < n;){
      |  ^
a.cc:10:3: error: expected primary-expression before '?' token
   10 | ????for(;l < n;){
      |   ^
a.cc:10:4: error: expected primary-expression before '?' token
   10 | ????for(;l < n;){
      |    ^
a.cc:10:5: error: expected primary-expression before 'for'
   10 | ????for(;l < n;){
      |     ^~~
a.cc:10:5: error: expected ':' before 'for'
   10 | ????for(;l < n;){
      |     ^~~
      |     :
a.cc:10:5: error: expected primary-expression before 'for'
   10 | ????for(;l < n;){
      |     ^~~
a.cc:10:5: error: expected ':' before 'for'
   10 | ????for(;l < n;){
      |     ^~~
      |     :
a.cc:10:5: error: expected primary-expression before 'for'
   10 | ????for(;l < n;){
      |     ^~~
a.cc:10:5: error: expected ':' before 'for'
   10 | ????for(;l < n;){
      |     ^~~
      |     :
a.cc:10:5: error: expected primary-expression before 'for'
   10 | ????for(;l < n;){
      |     ^~~
a.cc:10:5: error: expected ':' before 'for'
   10 | ????for(;l < n;){
      |     ^~~
      |     :
a.cc:10:5: error: expected primary-expression before 'for'
   10 | ????for(;l < n;){
      |     ^~~
a.cc:10:10: error: 'l' was not declared in this scope
   10 | ????for(;l < n;){
      |          ^
a.cc:10:16: error: expected primary-expression before ')' token
   10 | ????for(;l < n;){
      |                ^
a.cc:19:1: error: expected primary-expression before '?' token
   19 | ????if(res <= n)printf("%d\n", res);
      | ^
a.cc:19:2: error: expected primary-expression before '?' token
   19 | ????if(res <= n)printf("%d\n", res);
      |  ^
a.cc:19:3: error: expected primary-expression before '?' token
   19 | ????if(res <= n)printf("%d\n", res);
      |   ^
a.cc:19:4: error: expected primary-expression before '?' token
   19 | ????if(res <= n)printf("%d\n", res);
      |    ^
a.cc:19:5: error: expected primary-expression before 'if'
   19 | ????if(res <= n)printf("%d\n", res);
      |     ^~
a.cc:19:5: error: expected ':' before 'if'
   19 | ????if(res <= n)printf("%d\n", res);
      |     ^~
      |     :
a.cc:19:5: error: expected primary-expression before 'if'
   19 | ????if(res <= n)printf("%d\n", res);
      |     ^~
a.cc:19:5: error: expected ':' before 'if'
   19 | ????if(res <= n)printf("%d\n", res);
      |     ^~
      |     :
a.cc:19:5: error: expected primary-expression before 'if'
   19 | ????if(res <= n)printf("%d\n", res);
      |     ^~
a.cc:19:5: error: expected ':' before 'if'
   19 | ????if(res <= n)printf("%d\n", res);
      |     ^~
      |     :
a.cc:19:5: error: expected primary-expression before 'if'
   19 | ????if(res <= n)printf("%d\n", res);
      |     ^~
a.cc:19:5: error: expected ':' before 'if'
   19 | ????if(res <= n)printf("%d\n", res);
      |     ^~
      |     :
a.cc:19:5: error: expected primary-expression before 'if'
   19 | ????if(res <= n)printf("%d\n", res);
      |     ^~
a.cc:20:1: error: expected primary-expression before '?' token
   20 | ????else puts("0");
      | ^
a.cc:20:2: error: expected primary-expression before '?' token
   20 | ????else puts("0");
      |  ^
a.cc:20:3: error: expected primary-expression before '?' token
   20 | ????else puts("0");
      |   ^
a.cc:20:4: error: expected primary-expression before '?' token
   20 | ????else puts("0");
      |    ^
a.cc:20:5: error: expected primary-expression before 'else'
   20 | ????else puts("0");
      |     ^~~~
a.cc:20:5: error: expected ':' before 'else'
   20 | ????else puts("0");
      |     ^~~~
      |     :
a.cc:20:5: error: expected primary-expression before 'else'
   20 | ????else puts("0");
      |     ^~~~
a.cc:20:5: error: expected ':' before 'else'
   20 | ????else puts("0");
      |     ^~~~
      |     :
a.cc:20:5: err