首页 > TAG信息列表 > totalLen
挑战程序设计竞赛 2.1章习题 poj 2718 Smallest Difference dfs
Description Given a number of distinct decimal digits, you can form one integer by choosing a non-empty subset of these digits and writing them in some order. The remaining digits can be written down in some order to form a second integer. Unless the res2021-03-15
北大 算法基础 深搜之寻路 练习代码: #include<iostream> #include<vector> using namespace std; int K, N, R, S, D, L, T;//开始城市,到达城市,路长,花费 struct Road { int d, l, t; }; vector<vector<Road>> cityMaps(110);//城市邻接表,内vector保存各城市可到达的N02、替换空格(这题很容易)
2、替换空格 请实现一个函数,将一个字符串中的每个空格替换成“%20”。例如,当字符串为We Are Happy.则经过替换之后的字符串为We%20Are%20Happy。 1、首先统计出长度,然后从后向前替换 void replaceSpace(char *str,int length) {//int length是指当前的长度 int spac