【题目描述】
【输入】
【输出】
【输入样例】
21
【输出样例】
#include<iostream> #include<cmath> using namespace std; int main(){ int n,p,w; cin>>n; //极可能的缩小循环范围 w=int(sqrt(n)); for(p=2;p<=w;p++) if(n%p==0)break; cout<<n/p; return 0; }//OK
Powered by 孙会中 @ 2024-2026【 www.sunhuizhong.cn 】All rights reserved
访问统计:386183 本月:281 上月:799 今日:7 昨日:6 当前在线:1人