Python质因数分解 摘要:非原创参考代码:n=int(input())i=mx=2while(i**2<n): if n%i==0: &nbs…… 题解列表 2026年04月23日 0 点赞 0 评论 47 浏览 评分:0.0
不需要判断大小 摘要:解题思路:定义一个函数来判断质数,再用循环从小到大找数x,要求满足:1.该数是质数;2.n对该数的余数为…… 题解列表 2025年01月24日 0 点赞 0 评论 452 浏览 评分:0.0
质因数分解 不用引用math函数,极简 摘要:解题思路:大体思路相同,都是用平方根计算注意事项:参考代码:#include<stdio.h>int main(){ int n,max; scanf("%d",&n); for(i…… 题解列表 2024年11月18日 3 点赞 0 评论 535 浏览 评分:10.0
暴力拆解 分解质因数 直接算出最小的质因数 摘要:解题思路:某数已知是两个质数的乘积,这里设为n大质数设为b;小指数设为a根号下n一定大于较小的质数a(可数学验证),以此解决计算时间超时的问题参考代码:int n;scanf("%d",&n);int…… 题解列表 2024年08月21日 0 点赞 0 评论 509 浏览 评分:9.9
C语言简单思路 判度质数 摘要:解题思路:已知:n=i*(n/i),其中i与n/i都为质数,求最大质数。 因此,只需要将i从最小质数开始算,当i和(n/i)都为质数时,(n/i)变为最大质数。//(因为i…… 题解列表 2024年08月14日 0 点赞 0 评论 571 浏览 评分:9.9
质因数分解 摘要:解题思路:注意事项:参考代码n=int(input())f=2while f*f<=n: if n %f==0: print(n//f) f+=1…… 题解列表 2024年08月10日 0 点赞 0 评论 407 浏览 评分:0.0
2518: 信息学奥赛一本通T1620-质因数分解 摘要:解题思路:注意事项:参考代码:import mathdef is_qurt(n): flag = True for i in range(2,int(math.sqrt(n))+1): …… 题解列表 2024年07月31日 0 点赞 0 评论 650 浏览 评分:9.9
打印较大的质因数 摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<math.h>int main(){ int n,i,j,max; scanf("%d",&n); …… 题解列表 2024年04月18日 0 点赞 0 评论 665 浏览 评分:0.0
虽然能通过不过我感觉输入一些数答案不是质数!!!例如输入50会输出25!!! 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int n,i,j; scanf("%d",&n); for(i=2;i<n;i++) …… 题解列表 2024年04月16日 0 点赞 0 评论 387 浏览 评分:0.0
2518: 信息学奥赛一本通T1620-质因数分解 摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;int main(){ long long n; cin>>n; …… 题解列表 2024年04月16日 0 点赞 0 评论 397 浏览 评分:0.0