Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <cstdio>
#include <cstdlib>
#include <set>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,f,n) for(int i=(f);i<(n);i++)
 
int main(void){
    while(1){
        int n, k, ans = 0;
        cin >> n >> k;
        if(n == 0 && k == 0) break;//00???????????????????????????
        bool flag = false;//?????¨???????????????0??????????????????????????????????????°
        vector<bool> num(n + 1, false);//?????±??????????????????????????????
        rep(i, k){
            int tmp; scanf("%d", &tmp);
            if(tmp == 0){
                flag = true;
                continue;
            }
            num[tmp] = true;//?????±????????????
        }
        int pre = 0;//???????????£?¶??¢????????????°???????????°?????\????????????
        int cnt = 0;//?????????????????£?¶??¢????????????°???????????°????????????????????????????????¨
        int now;
        int end = 0;//???????????£?¶???¨????¢?????????????????????°????????\????????????
        bool rennkekanouflag = false;//??£??\????????£?¶??¢????????????????1?????¨?????????true
        reps(i, 1, n + 1){
            //??°???i????????????
            if(num[i] == true){
                if(i == end + 2) rennkekanouflag = true;//???????????£?¶??¢?????????¨?????????1
                cnt++;
            //??°???i???????????¨???
            }else{
                now = cnt;
                if(flag == true???&& rennkekanouflag = true;){
                    //?????¨?????????0????????????????????????????????£??\????????£?¶???¨??????????????°???1???????????¨?????????????????£?¶???¨???????????????????????£????????????
                    ans = max(ans, pre + now + 1);
                }else{
                    //???????????¶????????????????????¨?????????????????£?¶???¨????¢???????????????§?????§??????????????¢?????°??????
                    ans = max(ans, now);
                }
                // ?????????
                cnt = 0;
                rennkekanouflag = false;
                pre = now;//?????¢??£?????????
                end = i;
            }
        }
        printf("%d\n", ans);
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:33: error: expected primary-expression before '?' token
   39 |                 if(flag == true???&& rennkekanouflag = true;){
      |                                 ^
a.cc:39:34: error: expected primary-expression before '?' token
   39 |                 if(flag == true???&& rennkekanouflag = true;){
      |                                  ^
a.cc:39:35: error: lvalue required as left operand of assignment
   39 |                 if(flag == true???&& rennkekanouflag = true;){
      |                                   ^~~~~~~~~~~~~~~~~~
a.cc:39:60: error: expected ':' before ';' token
   39 |                 if(flag == true???&& rennkekanouflag = true;){
      |                                                            ^
      |                                                            :
a.cc:39:60: error: expected primary-expression before ';' token
a.cc:39:60: error: expected ':' before ';' token
   39 |                 if(flag == true???&& rennkekanouflag = true;){
      |                                                            ^
      |                                                            :
a.cc:39:60: error: expected primary-expression before ';' token
a.cc:39:60: error: expected ':' before ';' token
   39 |                 if(flag == true???&& rennkekanouflag = true;){
      |                                                            ^
      |                                                            :
a.cc:39:60: error: expected primary-expression before ';' token
a.cc:39:60: error: expected ')' before ';' token
   39 |                 if(flag == true???&& rennkekanouflag = true;){
      |                   ~                                        ^
      |                                                            )
a.cc:39:61: error: expected primary-expression before ')' token
   39 |                 if(flag == true???&& rennkekanouflag = true;){
      |                                                             ^
a.cc:42:18: error: 'else' without a previous 'if'
   42 |                 }else{
      |                  ^~~~
a.cc:39:38: error: label 'rennkekanouflag' used but not defined
   39 |                 if(flag == true???&& rennkekanouflag = true;){
      |                                      ^~~~~~~~~~~~~~~