?? result.cpp
字號:
1:#include <iostream.h>
2:const int N=10;
3:
4:void display(int a[], int n)
5:{ for(int i = 0; i < n; i ++) cout << a[i] << " ";
6: cout << endl;
7:}
8:
9:insert(int a[], int n, int x)
10:{ int i = 0, j;
11: while((x > a[i]) && i < n) i ++;
12: for(j = n-1; j >= i; j --) a[j] = a[j-1];
13: a[i] = x;
14:}
15:
16:main()
17:{ int s[N] = {2, 8, 11, 19, 24, 36, 50, 62, 85};
18: display(s, N-1);
19: insert(s, N, 55);
20: display(s, N);
21:}
22:
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -