最复杂的解题方法(但比较好理解) 摘要:解题思路:注意事项:参考代码:#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 评论 423 浏览 评分:0.0
简单算法,易理解 摘要:解题思路:注意事项:参考代码:a=list(map(int,input().split()))c=a[0]d=a[1]t=0while d%c!=0: t=d%c c=d d=tpr…… 题解列表 2024年11月13日 2 点赞 0 评论 437 浏览 评分:9.9
[编程入门]自定义函数处理最大公约数与最小公倍数 摘要:解题思路:一个主函数外加一个被调用函数,被调用函数中运用辗转相除法求最大公约数,主函数利用数学公式最小公倍数=a*b/最大公约数,求出最小公倍数。注意事项:被调用函数中使用辗转相除法时用while循环…… 题解列表 2024年10月20日 0 点赞 1 评论 863 浏览 评分:10.0
1027: [编程入门]自定义函数处理最大公约数与最小公倍数 摘要:```java import java.util.Scanner; public class Main { public static void main(String[] args) {…… 题解列表 2024年09月02日 0 点赞 0 评论 839 浏览 评分:9.9
编写题解 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 评论 673 浏览 评分:0.0
1027: [编程入门]自定义函数处理最大公约数与最小公倍数 摘要:```cpp #include using namespace std; int zdgys(int a,int b){ for(int i=a;i>=1;i--) if(a%i==0…… 题解列表 2024年07月02日 0 点赞 0 评论 490 浏览 评分:9.9
递归法(辗转相除法)求最大公约数 摘要:解题思路:用辗转相除法求最大公约数,在借助最大公约数求最小公倍数注意事项:参考代码:def yue(m,n): if n==0:return m else:return yue(n,m%n…… 题解列表 2024年06月01日 0 点赞 0 评论 452 浏览 评分:9.9
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 评论 336 浏览 评分:0.0
自定义函数处理最大公约数与最小公倍数 摘要:解题思路:题目要求要建函数,所以得知道怎么去建立函数,再考虑如何去求解,对于小白来说,解题的思路就是建立函数——建立主函数——调用函数注意事项:参考代码:#include<stdio.h>int gb…… 题解列表 2024年05月10日 0 点赞 0 评论 426 浏览 评分:0.0
无聊的星期六 摘要:解题思路:注意事项:参考代码:mun1,mun2=list(map(int,input().split())) max_num=max(mun1,mun2) min_num=min(mun1,…… 题解列表 2024年04月27日 0 点赞 0 评论 319 浏览 评分:0.0