![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
刷题
大豆砸ouo
这个作者很懒,什么都没留下…
展开
-
2021-03-21
2021/3/21 刷题记录:哪些用float哪些用doublesort(I,I+n,cmp)其中n为int,cmp返回bool原创 2021-03-21 19:12:14 · 70 阅读 · 0 评论 -
几种搜索算法原理比一比
A搜索:总代价 f(n) = g(n) + h(n),其中g(n)为从初始状态到达该状态的代价(这里一个状态也就是A算法里常说的一个节点),h(n)为从当前状态到目标状态的预估代价。因此,该算法的思路就是,每次寻找总代价f(n)最小的点进行扩展,直到找到终点。A*的具体过程可参考这篇博客,可参考这篇博客:https://blog.csdn.net/hitwhylz/article/details/23089415贪心搜索:代价f(n) = h(n),每次只考虑(可到达的)离目标节点最近的点进行扩展..原创 2021-03-10 23:24:07 · 298 阅读 · 0 评论 -
string 和char变来变去
输入string,输出string或者char[]string str;printf("%c",str[i]);//输出字符串printf("%s\n",str.c_str());//字符串变成字符数组原创 2021-03-10 19:14:28 · 59 阅读 · 0 评论 -
刷题记录:printf的奇奇怪怪用法
printf没有想到的用法string s=to_string(sum);//转成字符串//还能这样???for(int i=0;i<s.size();++i)printf("%s%s",i>0?" “:”",temp[s[i]-‘0’].c_str());输入:15 输出:one five原创 2021-03-10 17:51:39 · 83 阅读 · 0 评论