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
12 lines (10 loc) · 480 Bytes

File metadata and controls

12 lines (10 loc) · 480 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
# -*- coding:utf-8 -*-
__author__ = 'gjw'
__time__ = '2018/1/9 0009 上午 11:45'
# 题目:有一个已经排好序的数组。现输入一个数,要求按原来的规律将它插入数组中。
# 程序分析:首先判断此数是否大于最后一个数,然后再考虑插入中间的数的情况,插入后此元素之后的数,依次后移一个位置
a = [1, 4, 6, 9, 13, 16, 19, 28, 40, 100, 0]
x = int(input("请输入一个数"))
a.append(x)
a.sort()
print(a)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.