这是我的代码,你看看吧
```
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin>>n;
for(int i=2;i<=n;i++){
if(n%i==0){
cout<<n/i;
break;
}
}
return 0;
}
```
by wangjiayuan @ 2023-09-09 18:25:51
@[chenmumin](/user/682260)
This is mine
```cpp
#include<bits/stdc++.h>
using namespace std;
int main(){
int a,i,j,max=0;
cin>>a;
for(i=2;i<sqrt(a);i++){
if(a%i==0){
j=a/i;
break;
}
}
if(i>j){
max=i;
}else{
max=j;
}
cout<<max<<endl;
return 0;
}
```
可以参考一下
by Three_no @ 2023-09-09 18:29:36
```cpp
#include <iostream>
int main(){
int n;
std::cin>>n;
for(int i=2;i*i<=n;i++){
if(n%i==0){
std::cout<<n/i;
break;
}
}
return 0;
}
```
by jyz2012 @ 2023-09-18 21:48:19