1011: [编程入门]最大公约数与最小公倍数 摘要:解题思路:先算最大公倍数(或最小公倍数)然后用(n*m)/最大公约数(或最小公倍数)注意事项:n*m=最大公约数*最小公倍数参考代码:#include <iostream>using namespac…… 题解列表 2024年01月14日 0 点赞 0 评论 85 浏览 评分:9.9
更相减损法 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int x,y,z,a; scanf("%d %d",&x,&y); a = x*y; …… 题解列表 2024年01月11日 0 点赞 0 评论 141 浏览 评分:9.9
1011: [编程入门]最大公约数与最小公倍数 摘要:解题思路:注意事项:最小公倍数=两数之积/最大公因数参考代码:列表a, b = map(int,input().split())l = []s = []for i in range(1, min(a,…… 题解列表 2024年01月09日 0 点赞 0 评论 154 浏览 评分:0.0
最大公约数与最小公倍数 摘要: { int m, n; scanf("%d%d", &m, &n); if(m > n) { int t …… 题解列表 2024年01月03日 0 点赞 0 评论 95 浏览 评分:9.9
1011: [编程入门]最大公约数与最小公倍数 摘要:解题思路:辗转相除法注意事项:参考代码:#include <stdio.h>int gcd(int m, int n){ if (m % n == 0) return n; else re…… 题解列表 2023年12月30日 0 点赞 0 评论 126 浏览 评分:0.0
java 辗转相除法 摘要:解题思路:辗转相除法求最大公约数:两数中较小的数与两数相除余数的最大公约数注意事项:参考代码:1,普通法import java.util.Scanner; public class Main {…… 题解列表 2023年12月29日 0 点赞 0 评论 249 浏览 评分:9.9
最大公约数与最小公倍数 摘要:解题思路:注意事项:参考代码:#include <stdio.h>int main(){ int x,y; int i,j,min; scanf("%d %d",&x,&y); min=x; if(x…… 题解列表 2023年12月22日 0 点赞 0 评论 110 浏览 评分:0.0
(C++)最大公因数和最小公倍数求解 摘要:解题思路://最小公倍数:从m,n两之中最大的开始,如果该数能够同时被m,n整除,结束//最大公约数,从2开始,知道两个数中小的那个截止,//如果都不能让m,n整除,那么最大公约数就是1//max_c…… 题解列表 2023年12月21日 0 点赞 0 评论 110 浏览 评分:0.0
c语言递归解法 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int gcd(int a,int b){ (a%b==0) ? return b : return gcd(b,a%b)…… 题解列表 2023年12月12日 0 点赞 0 评论 98 浏览 评分:9.9