以下是使用 Python 语言解决此问题的示例代码: ```python def sort_votes(n, m, votes): votes.sort() return votes n = int(input()) m = int(input()) votes = [] for _ in range(m): vote = int(input()) votes.append(vote) sorted_votes = sort_votes(n, m, votes) for vote in sorted_votes: print(vote) ``` 这段代码首先定义了一个名为 `sort_votes` 的函数,用于对输入的选票列表进行排序。然后通过输入获取候选人数量 `n`、选票数量 `m` 和每张选票的数字,并将它们存储在列表 `votes` 中。最后调用 `sort_votes` 函数对选票进行排序,并打印出排序后的选票编号。 [2024-10-29 20:27:30 | AI写代码神器 | 184点数解答]