华为机试训练108题
以牛客网华为机试在线训练108题为基础,用Python实现
天一_1886
毕业于西北工业大学,硕士研究生,目前就职某大型知名外企,专注于云计算运维领域7年,VMware VCIX认证专家。
展开
-
字符串分隔-Python实现-华为机试
Python实现:str1 = input()str2 = input()def splitchar(string): if len(string) <= 8: print(string.ljust(8,'0')) else: while len(string) > 8: print(string[:8]...原创 2020-03-07 22:44:00 · 500 阅读 · 1 评论 -
明明的随机数-Python实现-华为机试
Python实现:while True: try: n = int(input()) sample = set() for i in range(n): sample.add(int(input())) for m in sorted(sample): print(m) ...原创 2020-03-07 22:41:20 · 2203 阅读 · 0 评论 -
计算字符个数-Python实现-华为机试
Python实现:str1 = input()str2 = input()count = 0for n in range(len(str1)): if str1[n].upper() == str2.upper(): count += 1print(count)原创 2020-03-07 22:35:14 · 332 阅读 · 0 评论