![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法
manng •ᴗ•
这个作者很懒,什么都没留下…
展开
-
八数码 bfs
代码: #include <iostream> #include <cstring> #include <queue> #include <algorithm> #include <unordered_map> //map有序,内部红黑树,查找效率低,会T //unordered_map内部哈希表,查找速度快,常用于查找问题 using namespace std; int mov[4.原创 2022-03-31 17:37:50 · 158 阅读 · 2 评论 -
洛谷 P1429 平面最近点对(加强版) (分治法)
⭐分治法⭐ #include <iostream> #include <cmath> #include <algorithm> using namespace std; const int N=2e5+10; const int INF=0x3f3f3f3f; int n; double res; struct node { double x,y; }v[N],vv[N]; void read() { scanf("%d",&n); for(int原创 2022-01-16 21:22:53 · 375 阅读 · 0 评论 -
返回指针值的函数
例题: 字符串的连接:输入两个字符串,输出连接后的字符串。要求自定义函数 char *strcat(char *s,char *t),将字符串t复制到字符串s的末端,并且返回字符串s的首地址。编写相应程序。 输入输出示例: abc def abcdef 代码: #include <stdio.h> #include <stdlib.h> char *strcat(char *s,char *t) { char *ps=s,*pt=t; while(*ps) ps++; whi原创 2021-06-19 11:21:43 · 81 阅读 · 0 评论 -
函数实现字符串复制
题目描述: 使用函数实现字符串复制:输入一个字符串t和正整数m,将字符串t中从第m个字符开始的全部字符复制到字符串s中,再输出字符串s。 要求自定义并调用函数void strmcpy(char *s,char *t,int m).编写相应程序。 输入输出示例: Enter a string:happy new year Enter a m:7 new year 代码: #include <stdio.h> #include <stdlib.h> void strmcpy(char原创 2021-06-19 11:18:50 · 9990 阅读 · 0 评论