C二级辅导-公约公倍 (C语言描述 辗转相除的精简) 摘要:解题思路:注意事项:参考代码:#include <stdio.h>#include <stdlib.h>int main(){ int k,l; scanf("%d%d",&k,&l); …… 题解列表 2018年01月17日 1 点赞 0 评论 998 浏览 评分:0.0
C二级辅导-公约公倍 (C++代码) 摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;int main(){ int i,m,n,f; cin>>m>>n; for(i=n;i>0…… 题解列表 2018年02月09日 0 点赞 0 评论 632 浏览 评分:0.0
C二级辅导-公约公倍 (C语言代码) 摘要:解题思路:注意事项:参考代码:/*输入两个正整数m和n,求其最大公约数和最小公倍数。*/#include<stdio.h>int main(){ int i,j,m,n,gy,gb; scanf("%…… 题解列表 2018年03月04日 1 点赞 0 评论 1166 浏览 评分:0.0
题解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 评论 693 浏览 评分:0.0
C二级辅导-公约数(两种解法) (C语言代码) 摘要:解题思路:第一种,利用减法第二种,利用除法注意事项:这里只给出公约数的解法公倍数我就不写了,公倍数就是用两数相乘再除以公约数参考代码:#include<stdio.h>#define max_swap…… 题解列表 2018年03月05日 0 点赞 0 评论 915 浏览 评分: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 评论 565 浏览 评分: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 评论 847 浏览 评分:0.0
C二级辅导-公约公倍 (C语言代码) 摘要:/* 2018年4月28日17:14:51 目的: 输入两个正整数m和n,求其最大公约数和最小公倍数。 */ #include <stdio.h> int main(void) …… 题解列表 2018年05月03日 0 点赞 0 评论 588 浏览 评分:0.0
C二级辅导-公约公倍 (C语言代码) 摘要:解题思路:注意事项: 我猜可能会有人问为什么不需要判断两个数的大小,我在这里的解释是 执行一次辗转相除, 就可以交换两个数. (不信自己试试) …… 题解列表 2018年07月13日 1 点赞 0 评论 904 浏览 评分:0.0