在哪你都看得到我记住这句话 摘要:解题思路:这个题目如果你了解过辗转相除法(欧几里得算法)那就很简单了辗转相除可以求得最大公约数gcd(a, b) = gcd(b, a % b)举个例子:第 1 步:a=24,b=1824 % 18 …… 题解列表 2026年03月19日 0 点赞 0 评论 67 浏览 评分:0.0
1011: [编程入门]最大公约数与最小公倍数 摘要:#include<stdio.h>intshu(inta,intb){intc,d,max,min;max=(a>b)?a…… 题解列表 2025年12月10日 1 点赞 0 评论 554 浏览 评分:0.0
编写题解 1011: [编程入门]最大公约数与最小公倍数 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int GongYueShu(int a,int b){ int temp; while(b!=0){ temp=a%b;…… 题解列表 2025年11月22日 1 点赞 0 评论 416 浏览 评分:0.0
用if和break来做,多种情况都考虑到了 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int m,n,max,min,i,j; scanf("%d%d",&m…… 题解列表 2025年11月02日 1 点赞 1 评论 551 浏览 评分:10.0
1011:求最大公因数和最小公倍数 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int gcd(int a,int b){ int temp; whil…… 题解列表 2025年10月21日 5 点赞 0 评论 790 浏览 评分:0.0
利用vector定义数组大小,static_cast显式转换 摘要:解题思路:注意事项:参考代码:#include <iostream>using namespace std;#include <vector>int main(){ int n…… 题解列表 2025年09月10日 0 点赞 0 评论 287 浏览 评分:0.0
编写题解 1011: [编程入门]最大公约数与最小公倍数 摘要: #includeusing namespace std ;int main(){ int t = 1 ; int m,n ; cin>>m>>n ;…… 题解列表 2025年06月05日 0 点赞 0 评论 1166 浏览 评分:2.0
T1011最大公约数和最小公倍数 摘要:解题思路:注意事项:参考代码:#(method 1th:)a,b=map(int ,input().strip().split())def gcd(a,b): if b==0…… 题解列表 2025年05月02日 2 点赞 0 评论 895 浏览 评分:10.0
辗转相除法 摘要:解题思路:辗转相除法注意事项:注意变量的值的变化参考代码:/*从小到大输入两个整数,求最大公约数和最小公倍数求m,n的最大公约数(辗转相除法)1)求 m%n=c2)若c=0,则除数n为两个…… 题解列表 2025年04月07日 6 点赞 0 评论 1060 浏览 评分:10.0
[编程入门]最大公约数与最小公倍数 摘要:```c#include int gcd(int a,int b){ return b==0?a:gcd(b,a%b);}int lcm(int a,int b){ r…… 题解列表 2025年03月09日 6 点赞 0 评论 1617 浏览 评分:6.0