提交时间:2024-01-30 15:24:15
运行 ID: 39056
#include<iostream> #include<cmath> using namespace std; int cmp(int num) { int cmp=0; for (int i=2;i<=sqrt(num);i++) { if (num%i==0) { cmp=max(i,num/i); } } return cmp; } int main() { int num; cin>>num; int cmp1=cmp(num); cout<<cmp1<<endl; return 0; }