文字排版

GitHub跳转原题关系图返回列表

本地题面缓存已迁移,解析内容待补充。

OJ: noi_openjudge

题目 ID: ch0113-17

难度:未知

标签:python

日期: 2026-07-30 23:01

题意

完整题面见同目录的 problem.md

思路

代码

Python代码

python
import sys

tokens = sys.stdin.read().split()
word_count = int(tokens[0])
words = tokens[1 : word_count + 1]
line = ""

for word in words:
    if not line:
        line = word
    elif len(line) + 1 + len(word) <= 80:
        line += " " + word
    else:
        print(line)
        line = word
print(line)

复杂度

总结