- 一级202206-5开关灯
关系运算实验
- 2023-12-31 15:15:26 @
#include<iostream>
using namespace std;
int main()
{
int n,m,t=0;
cin>>n>>m;
for(int i=1;i<=n;i++)
{
int f=0;
for(int j=1;j<=m;j++)
{
if(i%j==0)
f++;
}
if(f%2!=0)
{
t++;
if(t==1)
cout<<i;
else
cout<<" "<<i;
}
}
return 0;
}
0 comments
No comments so far...
Information
- ID
- 928
- Time
- 1000ms
- Memory
- 256MiB
- Difficulty
- 8
- Tags
- # Submissions
- 56
- Accepted
- 13
- Uploaded By