1062:简单易懂解法 摘要:解题思路:注意事项:参考代码:#include <stdio.h>int main(){ int m,n,s; scanf("%d%d",&m,&n); s=m; while(m%s!=0||n%s!…… 题解列表 2024年12月29日 0 点赞 0 评论 172 浏览 评分:0.0
C二级辅导-公约公倍 (Java代码) 摘要:import java.util.Scanner;public class Main { public static void main(String[] args) { Scan…… 题解列表 2019年03月06日 0 点赞 0 评论 408 浏览 评分:0.0
C二级辅导-公约公倍 (C语言代码) 摘要:解题思路:注意事项:最大公倍数=两数之积/最大公约数参考代码:#include<stdio.h>int gongyue(int m,int n){ if(m%n==0) return n; retur…… 题解列表 2019年04月30日 0 点赞 0 评论 325 浏览 评分:0.0
二级C语言-公约公倍 (C++描述) 摘要:a,b两个谁在前谁在后都不影响结果 #include using namespace std; int gcd(int a,int b) { if(a%b==0) retu…… 题解列表 2020年04月21日 0 点赞 0 评论 288 浏览 评分:0.0
C二级辅导-公约公倍 (C语言代码) 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int m,n,i; scanf("%d%d",&m,&n); for(i=m>n?m:n;i>0;i--) {…… 题解列表 2018年08月31日 0 点赞 0 评论 408 浏览 评分:0.0
二级C语言-公约公倍-题解(C++代码) 摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;int main(){ int m,n,i,s; cin>>m>>n; if…… 题解列表 2021年02月01日 0 点赞 0 评论 148 浏览 评分:0.0
公约公倍(辗转相除法) 摘要:解题思路:最大公约数用辗转相除,最小公倍数为两数之积除以最小公倍数注意事项:参考代码:#include<stdio.h>int a(int m,int n){ return (m%n==0)?n…… 题解列表 2022年07月31日 0 点赞 0 评论 93 浏览 评分:0.0
无聊的星期六 摘要:解题思路:注意事项:参考代码:#include<stdio.h> #define MAX(a,b) ((a)>(b)?(a):(b)) #define MIN(a,b) ((a)<(b)?(a):…… 题解列表 2024年04月27日 0 点赞 0 评论 105 浏览 评分:0.0
二级C语言- 公约公倍 (C语言代码) 摘要:解题思路:最大公约数的求法:1、用二者最大的除以最小的,能除尽,最小的那个数就是最大公约数2、不能除尽的就把最小值给最大值,最大值除最小值的余数给最小值最大公约和最小公倍数的关系:最大公约 X 最小公…… 题解列表 2021年03月25日 0 点赞 0 评论 121 浏览 评分:0.0
C二级辅导-公约公倍 (C语言代码) 摘要:#include<stdio.h>int main(){ int m,n,k; scanf("%d%d",&m,&n); int i=m,j=n; if(m>n) {m=m+n;n=m-n;m=m-n…… 题解列表 2017年07月01日 0 点赞 0 评论 805 浏览 评分:0.0