解题思路:
注意事项:
参考代码:
#include<bits/stdc++.h>
typedef long long ll;
const int N=1e5;
ll a[N];
using namespace std;
int main()
{
ll n,m;
cin>>n>>m;
for(int i=1; i<=m; i++)
{
for(int j=1; j<=n; j++)
{
if(j%i==0)
{
if(a[j]==0)
{
a[j]=1;
}
else
{
a[j]=0;
}
}
}
}
ll b=1;
for(int i=1; i<=n; i++)
{
if(a[i]==1)
{
if(b==1)
{
cout<<i;
b=0;
}
else
{
cout<<','<<i;
}
}
}
return 0;
}
0.0分
0 人评分