Description
已知顺序表L递增有序,编写程序,将X插入到线性表的适当位置上,以保持线性表的有序性。
Input
第一行输入顺序表元素个数elenum;(0<elenum<1000) 第二行输入顺序表L; 第三行输入插入值X。
Output
输出插入X后的有序顺序表
-
Sample Input
7
2 3 4 5 6 7 8
1
-
Sample Output
1 2 3 4 5 6 7 8
数组:
#include<iostream>
using namespace std;
int main(){