文章
81
粉丝
0
获赞
284
访问
11.5k
#include<bits/stdc++.h>
using namespace std;
bool yz(int n,int x){
if(n%x==0){
return true;
}else{
return false;
}
}
int main(){
int n,i,start,length=0,flag=0,max_length,mini_start;
cin>>n;
max_length=0;
mini_start=0;
for(i=2;i<=n;i++){
if(yz(n,i)){
if(flag == 0){
flag = 1;
start = i;
}
length++;
}else{
if(length>max_length){
max_length = length;
mini_start = start;
}
flag = 0;
length = 0;
}
}
for(i = 0;i<max_length;i++){
cout<<mini_start+i<<" ";
}
}
登录后发布评论
暂无评论,来抢沙发