1027: [编程入门]自定义函数处理最大公约数与最小公倍数 摘要:参考代码:#includeint fun1(int a,int b){ int yue=1,j=a,k=b; if(j>k){ j=b,k=a; } for(in…… 题解列表 2021年12月19日 0 点赞 0 评论 250 浏览 评分:0.0
自定义函数处理最大公约数与最小公倍数 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int i,j,a,b; int gye(int a,int b){ for(i=a;;i--) {if(a%i==0&&…… 题解列表 2021年12月18日 0 点赞 0 评论 288 浏览 评分:9.9
编写题解 1027: [编程入门]自定义函数处理最大公约数与最小公倍数 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int p(int x,int y); int q(int m,int n); int a,b; s…… 题解列表 2021年12月07日 0 点赞 0 评论 234 浏览 评分:0.0
[编程入门]自定义函数处理最大公约数与最小公倍数 摘要:解题思路:分别从a,b中较大的数和较小的数开始自增或自减得到最小公倍数和最大公因数注意事项:参考代码:#include<stdio.h>int main(){ int a,b; scanf("%d %…… 题解列表 2021年11月25日 0 点赞 0 评论 312 浏览 评分:9.9
1027wohuihuilaide正确的放马表该是这样 摘要:解题思路:注意事项:参考代码:#include <stdio.h>int main (){ int a,x,y,b,c; scanf("%d %d",&a,&b);x=a;y=b; while (b!…… 题解列表 2021年11月11日 0 点赞 0 评论 158 浏览 评分:9.9
[编程入门]自定义函数处理最大公约数与最小公倍数 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int fun1(int m,int n); //这要声明两个函数。也可以像下面那样写int fun2(int m,int n);…… 题解列表 2021年11月10日 0 点赞 0 评论 345 浏览 评分:0.0
自定义函数处理最大公约数与最小公倍数 摘要:解题思路:我没有用辗转相除,先计算两个数有相同的公因式的,那么最小公倍数就是你输入的较大的数,然后判断是不是两个奇数,那么最小公倍数就是两数之积(9,3这类的 数字已经被排除出去了),最后就是一个奇数…… 题解列表 2021年11月07日 0 点赞 0 评论 380 浏览 评分:0.0
个人见解,, 摘要:解题思路:注意事项:参考代码:int yin(int,int);int yin(int a,int b){ int i; for(i = a<b?a:b;a%i != 0||b%i != …… 题解列表 2021年11月05日 0 点赞 0 评论 254 浏览 评分:0.0
自定义函数处理最大公约数与最小公倍数 摘要:解题思路:注意事项:参考代码: def yue(a,b): min =(a<b and a or b) i=min while i>0: if a%i==0 and…… 题解列表 2021年11月04日 0 点赞 1 评论 624 浏览 评分:9.9
适合新手理解的c++ 摘要:#include<iostream>using namespace std;int add(int a,int b,int c){ if(a>b) { while(a%b!=0) { c=a%…… 题解列表 2021年11月03日 0 点赞 0 评论 581 浏览 评分:9.9