题解1062公约公倍 !最简单的答案! 摘要:解题思路:先最小公倍数,再最大公约注意事项:参考代码:#include<stdio.h>int main(){int i,m,n; scanf("%d %d",&m,&n); for(i=1;i<=m…… 题解列表 2018年03月04日 0 点赞 0 评论 1031 浏览 评分:0.0
C二级辅导-公约数(两种解法) (C语言代码) 摘要:解题思路:第一种,利用减法第二种,利用除法注意事项:这里只给出公约数的解法公倍数我就不写了,公倍数就是用两数相乘再除以公约数参考代码:#include<stdio.h>#define max_swap…… 题解列表 2018年03月05日 0 点赞 0 评论 1260 浏览 评分:0.0
C二级辅导-公约公倍 (C语言代码) 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int max(int a,int b){ if(b) return max(b,a%b); return a…… 题解列表 2018年04月04日 0 点赞 0 评论 910 浏览 评分:0.0
C二级辅导-公约公倍 (C语言代码) 摘要:解题思路:ab=cd,c为最大公约数,d为最小公倍数注意事项:参考代码:#include<stdio.h>int gcd(int a,int b);int main(){ int a,b; int c…… 题解列表 2018年04月26日 0 点赞 0 评论 1245 浏览 评分:0.0
C二级辅导-公约公倍 (C语言代码) 摘要:/* 2018年4月28日17:14:51 目的: 输入两个正整数m和n,求其最大公约数和最小公倍数。 */ #include <stdio.h> int main(void) …… 题解列表 2018年05月03日 0 点赞 0 评论 1055 浏览 评分:0.0
C二级辅导-公约公倍 (C语言代码) 摘要:解题思路:注意事项: 我猜可能会有人问为什么不需要判断两个数的大小,我在这里的解释是 执行一次辗转相除, 就可以交换两个数. (不信自己试试) …… 题解列表 2018年07月13日 1 点赞 0 评论 1597 浏览 评分:0.0
C二级辅导-公约公倍 (C语言代码)最新 摘要:解题思路辗转相除法 的使用注意事项:符号代替数值的变动参考代码:#include<stdio.h>int main(){ int m,n,t,a,x,y; scanf("%d%d",&m,&n); x…… 题解列表 2018年08月10日 2 点赞 0 评论 984 浏览 评分:0.0
C二级辅导-公约公倍 (C语言代码)(用自定义函数求最大公因数) 摘要:解题思路:注意事项:参考代码:#include <stdio.h>int main(){ int a,b,i; int gys(int m,int n); scanf("%d%d",&a,&b); i…… 题解列表 2018年08月20日 0 点赞 0 评论 1072 浏览 评分:0.0
C二级辅导-公约公倍 (C语言代码) 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int m,n,x,max,y,z; scanf("%d %d",&m,&n); if(m>n) {max=m…… 题解列表 2018年08月24日 0 点赞 0 评论 793 浏览 评分:0.0