摘要: 在初学dfs深度搜索的时候,会经常看到如下场景: int main() { cin >> N; dfs(1); return 0; } 看到这个的时候,我整个人就迷惑了:只有一个dfs(1)? 为什么是dfs(1),而不是dfs(N)??dfs究竟是什么在递归? 为了解决这些疑惑,我按着全排列的代码 阅读全文
posted @ 2022-01-25 19:34 白色飞碟 阅读(899) 评论(0) 推荐(0)
摘要: 用法: ret = strcmp(str1, str2); 如果返回值小于 0,则表示 str1 小于 str2。 如果返回值大于 0,则表示 str1 大于 str2。 如果返回值等于 0,则表示 str1 等于 str2 阅读全文
posted @ 2022-01-25 15:12 白色飞碟 阅读(513) 评论(0) 推荐(0)
摘要: 比较不为某字符串时,比较的“End of file”也要存储在char数组内 , (我第一次写成 s!=” End of file”,就是把它想当然了。) char s[100]; char end[100]={"End of file"};//用于判断是否结束 gets(s); if(strcmp 阅读全文
posted @ 2022-01-25 15:09 白色飞碟 阅读(90) 评论(0) 推荐(0)