1027 最大公约数与最小公倍数(只求最大公约数即可求解) 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int gongyueshu(int m,int n){ int max; if(m>n) { for(int i=n;i>=1;i-…… 题解列表 2024年05月14日 0 点赞 0 评论 268 浏览 评分:0.0
编写题解 1027: [编程入门]自定义函数处理最大公约数与最小公倍数 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int y(int a,int b) { for(int i=min(a,b);i>…… 题解列表 2024年08月09日 0 点赞 0 评论 607 浏览 评分:0.0
最复杂的解题方法(但比较好理解) 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int f1(int a,int b){ int s=0; if(a>=b) s=b; else s=a; wh…… 题解列表 2024年11月21日 0 点赞 0 评论 358 浏览 评分:0.0
普普通通的解题方法 摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include <math.h>int gys(int a,int b){ if (a%b == 0) return b; else …… 题解列表 2024年11月23日 0 点赞 0 评论 513 浏览 评分:0.0
[编程入门]自定义函数处理最大公约数与最小公倍数 C语言 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int a,b; int t,j; scanf("%d%d",&a,&b); j=a*b; while(1) {…… 题解列表 2024年11月30日 0 点赞 0 评论 852 浏览 评分:0.0
菜鸟代码,仅供参考 摘要:解题思路:对于两个整数aa和bb,它们的最大公约数(GCD)和最小公倍数(LCM)满足以下关系:GCD(a,b)×LCM(a,b)=a×bGCD(a,b)×LCM(…… 题解列表 2025年03月15日 1 点赞 0 评论 501 浏览 评分:0.0
自定义函数处理最大公约数与最小公倍数 摘要:解题思路:注意事项:参考代码:#include <stdio.h>int max(int a, int b){ int i = 1; int m = 0; int arr[10] = { …… 题解列表 2025年09月19日 0 点赞 0 评论 295 浏览 评分:0.0
T1027-自定义函数处理最大公约数与最小公倍数--三行解决(两种方法) 摘要:解题思路:注意事项:参考代码:#第一种方法defgcd(a,b):whileb!=0…… 题解列表 2025年11月04日 0 点赞 0 评论 164 浏览 评分:0.0
1027: [编程入门]自定义函数处理最大公约数与最小公倍数 摘要:解题思路:注意事项:参考代码:m,n = map(int,input().split()) def maxyue(x,y): if x>y: x,y=y,x s…… 题解列表 2022年01月14日 0 点赞 0 评论 371 浏览 评分:2.0
编程入门]自定义函数处理最大公约数与最小公倍数 摘要:解题思路:注意事项:参考代码:def max(n,m): if n < m: a = m b = n else: &n 题解列表 2022年04月03日 0 点赞 0 评论 379 浏览 评分:4.0