提交时间:2024-07-17 21:15:25

运行 ID: 156567

#include<bits/stdc++.h> using namespace std; int a,b,c,d,e,f,g,h,i,j,k; bool sushu(int x) { int y; for(y=3;y<=sqrt(x);y+=2) if(x%y==0) return 0; return 1; } int main() { cin>>a; if(a%2==0) { cout<<a/2; return 0; } for(b=3;b<=a;b+=2) { if(a%b==0) { if(sushu(b)==1) { cout<<a/b; return 0; } } } return 0; }