提交时间:2025-11-07 14:37:47
运行 ID: 73164
#include <iostream> #include <cstring> using namespace std; int main() { int N, M,x; cin >> N >> M; bool lt[666]; for(int i=1;i<=N;i++){ lt[i]=false; } for(int j=1;j<=M;j++){ x=1; while(x<=N){ if(x%j==0){ if(lt[x]==false){ lt[x]=true; }else{ lt[x]=false; } } x=x+1; } } for(int y=1;y<=N;y++){ if(lt[y]==true){ if(y!=1){ cout<<","<<y; }else{ cout<<y; } } } return 0; }