编写题解 1027: [编程入门]自定义函数处理最大公约数与最小公倍数(c语言) 摘要:解题思路:首先建两个函数:`gys` 和 `gbs`。`gys` 函数用于计算两个整数的最大公约数,采用递归的方式实现。`gbs` 函数用于计算两个整数的最小公倍数,通过最大公约数来计算。在 `mai…… 题解列表 2024年02月03日 0 点赞 0 评论 155 浏览 评分:0.0
C语言自定义函数处理最大公约数与最小公倍数 摘要:解题思路:注意事项:参考代码:#include<stdio.h> int max_gys(int a,int b) { return (a%b==0)?b:max_gys(b,a%b…… 题解列表 2024年02月08日 0 点赞 0 评论 87 浏览 评分:0.0
函数式编程思想解决 摘要:解题思路: 分别定义求解最大公约数和最小公倍数的函数,然后用类似map(int,input().spilt())等语句接受输入,定义main函数来打印这两个数注意事项: 注意函数接受的参数类型是数而非…… 题解列表 2024年02月28日 0 点赞 0 评论 152 浏览 评分:0.0
多用数学思想考虑考虑,EZ,收徒 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int main(){ int max,min,e; int a,b; …… 题解列表 2024年03月01日 0 点赞 0 评论 196 浏览 评分:0.0
1027: [编程入门]自定义函数处理最大公约数与最小公倍数 摘要:解题思路:注意事项:参考代码://思路 1.先求出两个数的最大公约数;//2.利用公式求最小公倍数=两个数的积/最大公约数#include <stdio.h>int main(){ int nu…… 题解列表 2024年03月11日 0 点赞 0 评论 181 浏览 评分:0.0
1027: [编程入门]自定义函数处理最大公约数与最小公倍数法二 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int fun1(int m,int n){ int min,num1; if(m>n){ min=n; …… 题解列表 2024年03月11日 0 点赞 0 评论 194 浏览 评分:0.0
题解 1027: [C语言]自定义函数处理最大公约数与最小公倍数 摘要:解题思路:注意事项:参考代码:#include <stdio.h> #include <string.h> #include <math.h> #include <stdlib.h> #inc…… 题解列表 2024年04月15日 0 点赞 0 评论 131 浏览 评分:0.0
自定义函数处理最大公约数与最小公倍数 摘要:解题思路:注意事项:参考代码:def function(a, b): c = min(a, b) max_GCD = 0 for i in range(1, c + 1)…… 题解列表 2024年04月18日 0 点赞 0 评论 358 浏览 评分:0.0
无聊的星期六 摘要:解题思路:注意事项:参考代码:mun1,mun2=list(map(int,input().split())) max_num=max(mun1,mun2) min_num=min(mun1,…… 题解列表 2024年04月27日 0 点赞 0 评论 155 浏览 评分:0.0
自定义函数处理最大公约数与最小公倍数 摘要:解题思路:题目要求要建函数,所以得知道怎么去建立函数,再考虑如何去求解,对于小白来说,解题的思路就是建立函数——建立主函数——调用函数注意事项:参考代码:#include<stdio.h>int gb…… 题解列表 2024年05月10日 0 点赞 0 评论 229 浏览 评分:0.0