专栏文章
我的收藏夹
个人记录参与者 1已保存评论 0
文章操作
快速查看文章及其快照的属性,并进行相关操作。
- 当前评论
- 0 条
- 当前快照
- 1 份
- 快照标识符
- @miqpa7b2
- 此快照首次捕获于
- 2025/12/04 08:31 3 个月前
- 此快照最后确认于
- 2025/12/04 08:31 3 个月前
【树状数组】(基础) ()
【KMP】⚙ filepath: str = input() dic : list = [] while True: ipt = input() if ipt != "DONE": dic.append(ipt) file = open(filepath, "r") output = open("out.cpp", "w") code = file.read() for i in range(dic.len()): code.replace(dic[i], '_' * (i+1)) code_list = code.split('\n') output_str: str = "" for code in code_list: output_str += code.lstrip() if code and code[0] == '#': output_str += '\n' output.write(output_str)
【KMP】⚙ filepath: str = input() dic : list = [] while True: ipt = input() if ipt != "DONE": dic.append(ipt) file = open(filepath, "r") output = open("out.cpp", "w") code = file.read() for i in range(dic.len()): code.replace(dic[i], '_' * (i+1)) code_list = code.split('\n') output_str: str = "" for code in code_list: output_str += code.lstrip() if code and code[0] == '#': output_str += '\n' output.write(output_str)
相关推荐
评论
共 0 条评论,欢迎与作者交流。
正在加载评论...