优质题解 BFS板子题(C++版) 摘要:# 分析题意 这道题是一道BFS的板子题,属于是在网格中寻找最短路。在求解无边权最短路问题时,我们一般都可以采用BFS来做。 # BFS BFS简而言之,就是优先考虑离当前节点最近的所有点,再依…… 题解列表 2023年10月29日 0 点赞 0 评论 1690 浏览 评分:9.9
三种方式实现输出计算该日在本年中是第几天 摘要:#define _CRT_SECURE_NO_WARNINGS#include<stdio.h>#include<string.h>typedef struct time { //这里的time是结…… 题解列表 2023年10月29日 0 点赞 0 评论 553 浏览 评分:9.9
自定义函数之数字后移 摘要:解题思路:先输出最后m位数,再输出前面的数参考代码:#include <stdio.h>void aa(int m,int n,int a[100]){ int i; for(i=n-m;i<n;i+…… 题解列表 2023年10月29日 0 点赞 1 评论 406 浏览 评分:9.9
分段函数!!! 摘要:解题思路:注意事项:参考代码:n=float(input())0<=n<=20a1=2.5-na2=2-1.5*(n-3)*(n-3)a3=n/2-1.5if 0<=n<5: print("%.…… 题解列表 2023年10月29日 0 点赞 1 评论 597 浏览 评分:9.9
两种方法实现成绩记录 摘要:解题思路:注意事项:参考代码:#define _CRT_SECURE_NO_WARNINGS#include<stdio.h>#include<string.h>struct student { c…… 题解列表 2023年10月29日 0 点赞 0 评论 523 浏览 评分:9.9
链表合并问题 摘要:解题思路:注意事项:参考代码:#include <stdio.h>#include <stdlib.h>// 定义链表结构体typedef struct node { int id; …… 题解列表 2023年10月29日 0 点赞 0 评论 549 浏览 评分:9.9
计算分数的浮点数值 摘要:解题思路:计算分数的浮点数值注意事项:b!=0参考代码:#include<stdio.h>int main(){ int a,b; scanf("%d%d",&a,&b); if(b…… 题解列表 2023年10月29日 0 点赞 0 评论 1171 浏览 评分:9.9
计算多项式的值 摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<math.h>int main(){ double x,a,b,c,d; scanf("%lf %lf %…… 题解列表 2023年10月29日 0 点赞 0 评论 1061 浏览 评分:9.9
[编程入门]密码破译 摘要:解题思路:自己看注意事项:参考代码:#include <stdio.h>void encryptPassword(char* str) { int i = 0; while (str[i]…… 题解列表 2023年10月29日 0 点赞 0 评论 811 浏览 评分:9.9
水仙花数判断 摘要:解题思路:首先表示这个三位数范围在100到999之间,再表示其百位,十位及个位数字。最后验证其百位,十位及个位数字的三次方之和是否等于该数字。注意事项:三个数字的表示参考代码:#include<std…… 题解列表 2023年10月30日 0 点赞 0 评论 499 浏览 评分:9.9