Information 等文件找不到
不知道你这个问题是否已经解决, 如果还没有解决的话: 1 #include <stdio.h>
2 int main()
3 {
4 int a[10] = {2,4,6,8,12,14,15,23,29};
5 int i,j,temp;
6 printf ("Enter an integer:\n");
7 scanf ("%d",&temp);
8
9 if (temp<a[0]) // 如果比a[0]小,则原数组依次向后顺移,补充a[0]为输入的temp
10 {
11 for (i=8;i>=0;i--)
12 {
13 a[i+1] = a[i];
14 }
15 a[0] = temp;
16 }
17 else
18 {
19 for (i=8;i>=0;i--)
20 {
21 if (temp < a[i])
22 {
23 a[i+1] = a[i];
24 }
25 else
26 {
27 a[i+1] = temp;
28 break;
29 }
30 }
31 }
32 for (j=0;j<10;j++)
33 {
34 printf ("%5d",a[j]);
35 }
36 printf ("\n");
37 return 0;
38 }