0 Compile Error

foo.cc:3:6: error: expected identifier before numeric constant
 int [5005],n,m;
      ^~~~
foo.cc:3:6: error: expected ']' before numeric constant
 int [5005],n,m;
      ^~~~
      ]
foo.cc:3:5: warning: structured bindings only available with -std=c++17 or -std=gnu++17
 int [5005],n,m;
     ^
foo.cc:3:5: error: structured binding declaration cannot have type 'int'
foo.cc:3:5: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
foo.cc:3:5: error: empty structured binding declaration
foo.cc:3:11: error: expected initializer before ',' token
 int [5005],n,m;
           ^
foo.cc: In function 'int main()':
foo.cc:6:12: error: 'n' was not declared in this scope
     cin >> n >> m;
            ^
foo.cc:6:12: note: suggested alternative: 'yn'
     cin >> n >> m;
            ^
            yn
foo.cc:6:17: error: 'm' was not declared in this scope
     cin >> n >> m;
                 ^
foo.cc:6:17: note: suggested alternative: 'tm'
     cin >> n >> m;
                 ^
                 tm
foo.cc:11:16: error: 'a' was not declared in this scope
             if(a[j]==0)
                ^
foo.cc:23:12: error: 'a' was not declared in this scope
         if(a[i]==0)
            ^

代码

#include<bits/stdc++.h>
using namespace std;
int [5005],n,m;
int main()
{
    cin >> n >> m;
    for(int i=1;i<=m;i++)
    {
        for(int j=i;j<=n;j+=i)
        {
            if(a[j]==0)
            {
                a[j]=1;
            }
            else
            {
                a[j]=0;
            }
        }
    }
    for(int i=1;i<=n;i++)
    {
        if(a[i]==0)
        {
            cout << i << " ";
        }
    }
    return 0;
}

信息

递交者
题目
DJKS1015  硬币翻转
比赛
2024年3月等考一级题单
语言
C++ 14
递交时间
11 个月前
评测时间
11 个月前
分数
0
总耗时
0ms
峰值内存
0 Bytes