Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
71866 LJY 19灯的编号 C++ Compile Error 0 MS 0 KB 358 2024-04-27 17:54:25

Tests(0/0):


Code:

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


Run Info:

Main.cc: In function 'int main()':
Main.cc:7:24: error: 'memset' was not declared in this scope
    memset(a,0,sizeof(a));
                        ^
Main.cc:5:11: warning: unused variable 'first' [-Wunused-variable]
   int n,k,first=1;  
           ^