Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
19 lines (13 loc) · 516 Bytes

File metadata and controls

19 lines (13 loc) · 516 Bytes
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# -*- coding:utf-8 -*-
__author__ = 'gjw'
__time__ = '2018/1/9 0009 上午 10:44'
# 题目:对10个数进行排序。
# 程序分析:可以利用选择法,即从后9个比较过程中,选择一个最小的与第一个元素交换,下次类推,即用第二个元素与后8个进行比较,并进行交换。
N = int(input("请输入排序数的个数"))
l = []
print("------------")
for i in range(N):
x = int(input("请输入需要的第"+str(i+1)+"数:"))
l.append(x)
l.sort()
print(l)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.