Python的辗转相除 摘要:def gcd(a,b): while b: a,b=b,a%b return a a=int(input()) b=int(input()) print(…… 题解列表 2024年08月08日 0 点赞 0 评论 216 浏览 评分:0.0
辗转相除最终归纳! 摘要:1.c++写#include<bits/stdc++.h> using namespace std; int _gcd(int a,int b) { while(b!=0)//可以简写…… 题解列表 2024年08月08日 0 点赞 0 评论 276 浏览 评分:0.0
原来不难,就只有第一个单词特殊啊 摘要:#include<bits/stdc++.h> using namespace std; int main() { string s; while(getline(cin,s)) {…… 题解列表 2024年08月08日 0 点赞 0 评论 189 浏览 评分:0.0
最暴力的写法 摘要:#include<bits/stdc++.h> using namespace std; int main() { int n; cin>>n; for(int i=0;i<=n;i…… 题解列表 2024年08月08日 0 点赞 0 评论 240 浏览 评分:8.0
这个题细节很多,wa了很多次 摘要:#include<bits/stdc++.h> using namespace std; int main() { int n; string s; cin>>n>…… 题解列表 2024年08月08日 0 点赞 0 评论 265 浏览 评分:0.0
1108: 守望者的逃离 贪心 摘要:解题思路:贪心注意事项:参考代码:#include<iostream> #include<cmath> using namespace std; int main() { int m,s,…… 题解列表 2024年08月08日 2 点赞 0 评论 489 浏览 评分:0.0
三个字符串的排序,使用选择排序 摘要:解题思路: 输入三个字符串,并存入一个数组中,对该数组元素进行选择排序。注意事项:无参考代码:#include<iostream> using namespace std; #include<st…… 题解列表 2024年08月09日 3 点赞 1 评论 658 浏览 评分:10.0
1159: 偶数求和的一种解决方法 摘要:解题思路:题目对数列的定义是长度为n,公差为2的一个等差数列,那么可以这样理解数列中的每个元素值都是k=2*i(i=1,2,3.....n),这样每次求和只需要变量sum加上2*i即可。当i等于m的倍…… 题解列表 2024年08月09日 0 点赞 0 评论 232 浏览 评分:0.0
计算2的N次方 摘要:解题思路:高精度乘法注意事项:参考代码:#include<iostream> #include<algorithm> using namespace std; const int N = 1e3…… 题解列表 2024年08月09日 1 点赞 0 评论 354 浏览 评分:0.0
Hanoi双塔问题 摘要:解题思路:高精度 2 * (2 ^ n - 1)注意事项:参考代码:#include<iostream> #include<cmath> using namespace std; const i…… 题解列表 2024年08月09日 0 点赞 0 评论 439 浏览 评分:0.0