Curry_Skyfxxker @ 2022-09-08 21:50:59
woc
#include<bits/stdc++.h>
using namespace std;
int main(){
int n,m;cin>>n>>m;
int a[n];
for(int i=1;i<=n;i++)a[i]=0;
cout<<"1";
for(int i=2;i<=n;i++)
for(int j=2;j<=m&&j<=i;j++)
if(i%j==0)a[i]=!a[i];
for(int i=2;i<=n;i++)
if(a[i]==0)cout<<","<<i;
}
怎么改
by Katz @ 2022-09-08 21:53:03
介不就是完全平方数咩
by Curry_Skyfxxker @ 2022-09-08 21:55:35
@kelvin_0425 怎么哪都能看到你
by Katz @ 2022-09-08 21:56:20
@Curry_Skyfxxker
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
for(int i=1;i*i<=n;i++)
cout<<i*i<<" ";
cout<<endl;
}
AC代码
by Katz @ 2022-09-08 21:56:48
@Curry_Skyfxxker 我天天颓废(
by Curry_Skyfxxker @ 2022-09-08 21:57:10
@kelvin_0425 emmmmm
by Ehtan @ 2022-10-06 20:44:12
using namespace std;
int main(){
int n;
cin>>n;
for(int i=1;i*i<=n;i++) cout<<i*i<<" ";
return 0;
by kuikuidadi @ 2023-01-25 09:30:27
其实就这样!!
#include<bits/stdc++.h>
using namespace std;
int main(){
int n,m;cin>>n>>m;
int a[n];
for(int i=1;i<=n;i++)a[i]=0;
cout<<"1";
for(int i=2;i<=n;i++)
for(int j=2;j<=m&&j<=i;j++)
if(i%j==0)a[i]=!a[i];
for(int i=2;i<=n;i++)
if(a[i]==0)cout<<" "<<i;//是“ ”不是“,”
}