编写题解 1027: [编程入门]自定义函数处理最大公约数与最小公倍数 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int y(int a,int b) { for(int i=min(a,b);i>…… 题解列表 2024年08月09日 0 点赞 0 评论 549 浏览 评分:0.0
不用考虑斜率不存在和分母为0的方法——余弦定理 摘要:解题思路:参考代码:#include<bits/stdc++.h> using namespace std; #define PI 3.14159265358979323846 void sol…… 题解列表 2024年08月09日 0 点赞 0 评论 254 浏览 评分:0.0
最后一个点卡数组小于k和多组数据 摘要:#include<bits/stdc++.h> using namespace std; int main() { int t,k; while(cin>>t>>k) …… 题解列表 2024年08月09日 0 点赞 0 评论 196 浏览 评分:0.0
简明易懂的c语言解法,其他语言也可以借鉴 摘要:解题思路:如果b是a的因数和,我们再去检验b的因数和是不是a,所以对于每个a,先让b=a的因数和,就可以大大减少计算注意事项:这道题要通过思考a、b关系简化运算,不然容易超时参考代码:#include…… 题解列表 2024年08月09日 0 点赞 0 评论 393 浏览 评分:9.9
2^k进制数:组合数 摘要:解题思路:组合数注意事项:参考代码:#include<iostream> #include<cmath> using namespace std; long long c(int n, int …… 题解列表 2024年08月09日 0 点赞 0 评论 320 浏览 评分:0.0
计算素数和(用C++) 摘要:参考代码:#include<iostream> using namespace std; bool isprime(int x) { int count = 0; for (int i …… 题解列表 2024年08月10日 0 点赞 0 评论 382 浏览 评分:7.3
质因数分解 摘要:解题思路:注意事项:参考代码n=int(input())f=2while f*f<=n: if n %f==0: print(n//f) f+=1…… 题解列表 2024年08月10日 0 点赞 0 评论 258 浏览 评分:0.0
IP判断 简单易懂(C语言代码) 摘要:```c #include #include #include #define lenth 256 // 检查给定的字符串是否为有效的IPv4地址 // 参数s: 表示IPv4地址的字符串…… 题解列表 2024年08月10日 2 点赞 0 评论 537 浏览 评分:10.0
二级C语言-自定义函数 摘要:解题思路: 采用递归求解注意事项: 包含#include<iomanip>以保证输出4位小数;参考代码:#include<iostream> using namespace std; #inclu…… 题解列表 2024年08月10日 0 点赞 0 评论 473 浏览 评分:7.0
DNA打印(新手容易理解) 摘要:解题思路: 先尝试打印一次对称的DNA,然后跑一个循环打印n次注意事项: ① 由于n次循环中,有一行的是重复的,单独拎出来打印; ② 'X'是大写的参考代码:d…… 题解列表 2024年08月10日 0 点赞 0 评论 339 浏览 评分:9.9