牛客网华为机试题之Python解法 第1题 字符串最后一个单词的长度 a = input().split(" ") print(len(a[-1])) 第2题 计算字符个数 a = input() b = input() print(a.lower().count(b.lower())) 第3题 明明的随机数 while True: try: num = int(input()) data = [] for i in range(num): data.append(int(input(…
NodeTree类 public class NodeTree { private int num; private NodeTree left; private NodeTree right; public int getNum() { return num; } public void setNum(int num) { this.num = num; } public NodeTree getLeft() { return left; } public void setLeft(NodeT…