Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
124519 晏莞煜 19灯的编号 C++ Compile Error 0 MS 0 KB 258 2025-07-11 16:38:39

Tests(0/0):


Code:

#include<iostream> using namespace std; int main(){ int n,m; cin>>n>>m; int a[n+1]={0},int p=1; for(int i=1;i<=n;i++){ if(i%p==0){ a[i]++; } p++; } for(int i=1;i<=n;i++){ if(a[i]%2!=0){ cout<<i<<","; } } return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:6:17: error: expected unqualified-id before 'int'
  int a[n+1]={0},int p=1;
                 ^
Main.cc:8:8: error: 'p' was not declared in this scope
   if(i%p==0){
        ^
Main.cc:11:3: error: 'p' was not declared in this scope
   p++;
   ^