题目: Jesus, what a great movie! Thousands of people are rushing to the cinema. However, this is really a tuff time for Joe who sells the film tickets. ...
分类:
其他好文 时间:
2020-06-24 19:34:23
阅读次数:
52
题目:请实现一个函数,将一个字符串中的每个空格替换成“%20”。例如,当字符串为We Are Happy.则经过替换之后的字符串为We%20Are%20Happy。 1. 题目难度:四星 2. 考察点:字符串 方法:逆向遍历 1. 分析:由于函数返回为void,说明此题不能另外开辟数组,需要in-p ...
分类:
其他好文 时间:
2020-06-23 13:23:07
阅读次数:
56
根据开始和结束位置截取字符串: public String substring(int beginIndex): "unhappy".substring(2) returns "happy" "Harbison".substring(3) returns "bison" "emptiness".su ...
分类:
其他好文 时间:
2020-06-19 16:19:10
阅读次数:
60
"""这是第四章的案例题"""magicians = ["alice","david","carolina","eric","alex"] #创建一个列表mes = "see you happy." #赋值一个字符串给变量for magician in magicians:#一个for循环 ,":" ...
分类:
编程语言 时间:
2020-06-18 11:19:23
阅读次数:
82
Description Once in a forest, there lived \(n\) aggressive monkeys. At the beginning, they each does things in its own way and none of them knows each ...
分类:
其他好文 时间:
2020-06-13 00:21:23
阅读次数:
79
A:Saving Tang Monk 总时间限制: 1000ms 内存限制: 65536kB描述 《Journey to the West》(also 《Monkey》) is one of the Four Great Classical Novels of Chinese literature. ...
分类:
其他好文 时间:
2020-06-09 23:56:43
阅读次数:
153
请实现一个函数,把字符串中的每个空格替换成"%20"。例如输入“We are happy.”,则输出“We%20are%20happy.”。 C++版本 // // 《剑指Offer——名企面试官精讲典型编程题》代码 // 作者:何海涛 // // 面试题5:替换空格 // 题目:请实现一个函数,把 ...
分类:
其他好文 时间:
2020-06-03 20:28:40
阅读次数:
46
The Happy Prince and Other Tales 给定长度为 \(n+1\) 的数列 \(\langle a_i\rangle_{i=0}^n\),请对于 \(\forall m\in[0,n]\) 输出 \(f_m(n)\bmod 998244353\), \[ f_m(n)=\s ...
分类:
移动开发 时间:
2020-06-01 12:04:31
阅读次数:
70
解法一:哈希表 class Solution { public: bool isHappy(int n) { set<int> seen; while (n != 1 && !seen.count(n)) //快乐或者存在环跳出 { seen.insert(n); n = getNext(n); } ...
分类:
移动开发 时间:
2020-05-29 10:23:19
阅读次数:
61
题目如下: A happy string is a string that: consists only of letters of the set ['a', 'b', 'c']. s[i] != s[i + 1] for all values of i from 1 to s.length - ...
分类:
移动开发 时间:
2020-05-29 10:03:22
阅读次数:
64