Python代码-去掉空格 摘要:```pythonif __name__ == '__main__': while True: try: str1 = str(input()…… 题解列表 2025年02月17日 0 点赞 0 评论 416 浏览 评分:0.0
1196: 去掉空格 摘要:解题思路:注意事项:参考代码:while True: try: s = input() print(s.replace(' ', '…… 题解列表 2024年04月19日 0 点赞 0 评论 831 浏览 评分:0.0
编写题解 1196: 去掉空格 摘要:解题思路:注意事项:参考代码:while True: try: list1 = input().split() for i in list1: …… 题解列表 2023年02月15日 0 点赞 0 评论 765 浏览 评分:9.9
1196一行解(Python) 摘要:解题思路:将空格替换为空('')注意事项:明确sys.stdin的用法参考代码:import sysfor line in sys.stdin :print(line.replace(…… 题解列表 2022年11月04日 0 点赞 0 评论 562 浏览 评分:9.9
1196——————去掉空格 a=input()whileTrue:print(a.replace('',''))a=input()#凑字数凑字数凑字数凑字数凑字数凑字数凑字数凑字数 题解列表 2022年08月03日 0 点赞 0 评论 732 浏览 评分:6.0
去掉空格-题解(Python代码)-replace替换 摘要:解题思路:replace替换参考代码:s = input() while s != 'End of file': print(s.replace(' ',&…… 题解列表 2021年01月21日 0 点赞 0 评论 982 浏览 评分:8.9
去掉空格-题解(Python代码)----python无EOF,可以使用stdin或者异常来处理 ###描述:在很多OJ题中输入要求多行输入,但是不指定输入的行数,所以要求以EOF(Endoffile)结束###分析:在C语言中,可以直接判断即可:c=getchar())!=EOF返回Boolean型在python没有EOF,故可以通过“stdin”或者“异常”来实现###代码:**方案一:使用s 题解列表 2020年01月19日 0 点赞 0 评论 1574 浏览 评分:9.9