最大公约数与最小公倍数 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int m,n,x,y,t;printf("请输入两个整数;\n“) scanf("%d%d",&m,&n); …… 题解列表 2024年01月26日 0 点赞 0 评论 441 浏览 评分:2.0
枚举测试法求最大公约数与最小公倍数 解题思路:用循环枚举逐一测试是否满足最大公约数的条件与最小公倍数的条件注意事项:最大公约数从最小的公约数1开始,往上递增到其中一个数,最小公倍数从最大的公倍数m*n开始,向下递减至其中一个数。参考代码:#includeintmain(){intm, 题解列表 2024年01月17日 0 点赞 0 评论 522 浏览 评分:0.0
最大公约数与最小公倍数 1011 摘要:解题思路:#include<iostream>#include<algorithm>using namespace std;int main(){int a,b;cin>>a>>b;cout<<__g…… 题解列表 2024年01月15日 0 点赞 0 评论 484 浏览 评分: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 评论 526 浏览 评分:9.9
经典解题步骤 摘要:参考代码:#include<stdio.h> int main() { int m, n; scanf("%d%d", &m, &n); if(m > n) { int t …… 题解列表 2024年01月03日 0 点赞 0 评论 436 浏览 评分: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 评论 472 浏览 评分:0.0
最大公约数与最小公倍数 摘要:解题思路:注意事项:参考代码:#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 评论 416 浏览 评分: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 评论 468 浏览 评分:9.9
暴力穷举找最大公约数和最小公倍数 摘要:首先感谢指正,我的第一代代码考虑不全,虽然能过测试,但是出现特殊值就要完蛋。这是我的第一代#include<stdio.h> int main() { int a,b,t=1; scanf…… 题解列表 2023年12月10日 0 点赞 0 评论 507 浏览 评分:9.9
1011: [编程入门]最大公约数与最小公倍数 摘要:参考代码:#include<stdio.h>int main(){ int m, n,i,k,f; scanf_s("%d %d", &m, &n); if (m > n) { k = m; m = …… 题解列表 2023年11月29日 0 点赞 0 评论 478 浏览 评分:8.0