输入两个正整数m和n,求其最大公约数和最小公倍数。 摘要:解题思路:接受输入,先求最大公约数,最后求公倍数,然后输出注意事项:按顺序求解即可参考代码:#include<iostream> #include <cstring> #include <math…… 题解列表 2024年06月25日 0 点赞 0 评论 375 浏览 评分:9.9
动态规划的一般解题方法 摘要:解题思路:注意事项:参考代码:#include<iostream> using namespace std; int arr[100][100] ={0}; int dp[100][100]…… 题解列表 2024年06月25日 0 点赞 0 评论 247 浏览 评分:0.0
tarjan的离线做法 摘要:刚学习tarjan求最近公共祖先,以此题记录 要求的两点距离可用两点深度之和减去两点公共祖先节点的深度,即: d[x,y]=d[0,x]+d[0,y]-2*d[0,p] ~~~ #incl…… 题解列表 2024年06月24日 0 点赞 0 评论 348 浏览 评分:9.9
数列(多项式之和) 摘要:解题思路: 转二进制: 多项式之和注意事项:参考代码:#include<iostream> using namespace std; const int N = 1e3 + 10; int a[…… 题解列表 2024年06月23日 2 点赞 1 评论 609 浏览 评分:9.9
链式栈的练习,可供食用参考... 摘要:解题思路:无注意事项:无参考代码:#include<stdio.h>#include<stdlib.h>#include<stdbool.h>#include<string.h>typedef str…… 题解列表 2024年06月23日 0 点赞 0 评论 374 浏览 评分:9.9
顺序栈练习,可供食用 摘要:解题思路:简陋代码但还算简单,可供食用参考。注意事项:①清理缓冲区换行符。 ②题目要求:一次开始时堆栈为空。参考代码:#include#include#include#i…… 题解列表 2024年06月23日 0 点赞 0 评论 354 浏览 评分:9.9
迭代法求平方根 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ float X; scanf("%f", &X); float x1, x2; x1 =…… 题解列表 2024年06月22日 0 点赞 0 评论 271 浏览 评分:0.0
C语言训练-大小写问题 摘要:参考代码:#include <stdio.h>#include<ctype.h>#include<string.h>int main(){ char a[100] = {'\0'}…… 题解列表 2024年06月22日 0 点赞 0 评论 504 浏览 评分:9.9
求矩阵的两对角线上的元素之和 摘要:参考代码:#include<stdio.h>int main(){ int x,y,sum=0,N,a[10][10]; scanf("%d",&N); for(x=0;x<N;x++){…… 题解列表 2024年06月22日 0 点赞 0 评论 414 浏览 评分:9.9
最适合新手的解法 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int k;scanf("%d",&k);if(k<=2){ printf("1");}else{ int a[…… 题解列表 2024年06月22日 0 点赞 0 评论 435 浏览 评分:0.0