本文共 361 字,大约阅读时间需要 1 分钟。
class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param s string字符串 * @return string字符串 */ string replaceSpace(string s) { // write code here string res=""; for(char c:s) { if(c!=' ') res+=c; else res+="%20"; } return res; }};
转载地址:http://inklf.baihongyu.com/