程序如下
#include<iostream> using namespace std; int main(){ int a,b=1; cin>>a; for(int i=2;i<=a/2;i++){ if(a%i==0) if(i>b) b=i; } cout<<b; return 0; }