当前位置:网站首页>openjudge:过滤多余的空格
openjudge:过滤多余的空格
2022-07-28 05:18:00 【编程器系统】
描述
一个句子中也许有多个连续空格,过滤掉多余的空格,只留下一个空格。
输入
一行,一个字符串(长度不超过200),句子的头和尾都没有空格。
输出
过滤之后的句子。
样例输入
Hello world.This is c language.
样例输出
Hello world.This is c language.
代码
s = input().split()
for i in s:
print(i, end=" ")边栏推荐
- Mysql数据库索引(innodb引擎)
- SimpleDateFormat线程不安全和DateTimeFormatter线程安全
- C language characters and strings
- MySQL adds sequence number to query results
- You must configure either the server or JDBC driver (via the ‘serverTimezone)
- Distillation model diagram
- 个人写的一个文件上传工具网站
- mysql 为查询结果增加序号
- restFul接口使用个人总结
- First acquaintance with C language (1)
猜你喜欢

JUC笔记

ECCV22 最新54篇论文主图整理

Struct模块到底有多实用?一个知识点立马学习

Invalid bound statement (not found): com.exam.mapper.UserMapper.findbyid

First acquaintance with C language (1)

Mysql基本查询

Google browser cannot open localhost:3000. If you open localhost, you will jump to the test address

How practical is the struct module? Learn a knowledge point immediately

MySQL date and time function, varchar and date are mutually converted

7.<tag-字符串和API的取舍>补充: 剑指 Offer 05. 替换空格
随机推荐
regular expression
latex和word之间相互转换
ECCV22 最新54篇论文主图整理
分享几种管理C程序中标志位的方法
[computer level 3 information security] overview of information security assurance
Framework step by step easy-to-use process
24小时内的时间段无交叉
ByteBuffer. Position throws exception illegalargumentexception
【SLAM】LVI-SAM解析——综述
低照度图像数据集
Response < t > class
蒙特卡罗方法求解圆周率π并用turtle画点,以及完成进度条问题
Mysql基本查询
ByteBuffer.position 抛出异常 IllegalArgumentException
oracle查看锁表语句、解锁方法
正则表达式
Oracle用sql查询某张表的字段信息(字段类型、长度等)
Google browser cannot open localhost:3000. If you open localhost, you will jump to the test address
regular expression
mysql中使用list作为参数进行查询