编写题解 1011: [编程入门]最大公约数与最小公倍数 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int main(){ int x,y,a,b,p; cin>>x>>y; for…… 题解列表 2022年03月25日 0 点赞 0 评论 467 浏览 评分:0.0
辗转相除法 摘要:```cpp #include using namespace std; int gcd(int a, int b){ return b ? gcd(b, a % b) : a; …… 题解列表 2022年03月15日 0 点赞 0 评论 335 浏览 评分:0.0
1011: [编程入门]最大公约数与最小公倍数 摘要:解题思路:求gcd要用辗转相除法,原理就不多赘述了;求lcm就用两数之积除去它们的gcd。注意事项:理解辗转相除法的原理就行。参考代码:#include <iostream> using nam…… 题解列表 2022年02月20日 0 点赞 0 评论 646 浏览 评分:9.9
从基础不好的角度来进行gcd和lcm函数应用 摘要:解题思路:注意事项:参考代码:#include <iostream>#include <iomanip>using namespace std;int gcd(int a, int b) { //求最…… 题解列表 2022年02月12日 0 点赞 0 评论 592 浏览 评分:9.9
1011: [编程入门]最大公约数与最小公倍数 摘要:解题思路:辗转相除法注意事项:m,n需保留原值参考代码:#include <stdio.h>#include <algorithm> #include <bitset> #include …… 题解列表 2022年01月03日 0 点赞 1 评论 463 浏览 评分:4.7
编写题解 1011: [编程入门]最大公约数与最小公倍数 VS2019 摘要:参考代码:#include<bits/stdc++.h>using namespace std;int main(){int a,b,c,d=1,a1,b1;cin>>a>>b;a1=a;b1=b;i…… 题解列表 2021年12月31日 0 点赞 0 评论 796 浏览 评分:8.7
c++语言1011题 摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std ;int main(){ int t = 1 ;//取余计算的余数,赋值为1是为了方便进…… 题解列表 2021年09月24日 0 点赞 0 评论 726 浏览 评分:4.0
c++语言1011题 摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std ;int main(){ int t = 1 ;//取余计算的余数,赋值为1是为了方便进…… 题解列表 2021年09月24日 0 点赞 0 评论 391 浏览 评分:0.0
用c++中库函数__gcd()求最小公倍数 摘要:解题思路: 用c++中库函数__gcd()求最小公倍数,代码非常简洁,hhh注意事项: 要包含头文件#include< 题解列表 2021年08月31日 0 点赞 1 评论 2299 浏览 评分:8.9
编程入门]最大公约数与最小公倍数 摘要:解题思路:注意事项:参考代码#include<iostream>using namespace std;int main(){ int i,j,k,m,n,p; int sum=1; cin>>m; …… 题解列表 2021年05月31日 0 点赞 0 评论 906 浏览 评分:9.9