第一个f(x)是怎么化成那个形式的,还有13的C选项,没有领域怎么连续?
#include<time.h>
#include<stdio.h>
#include<stdlib.h>
int ListIn(int x)
{
int a[7] = {1, 2, 3, 5, 6, 7, 0}; // 定义递增有序的顺序表
int i = 0;
int j;
int cc = 0;
{ // 调试代码区域
int aa = 0;
for( aa; aa<7; aa++)
printf("%d ", a[aa]);
}
while( 1 )
{
if( a[i] <= x && a[i+1] >= x ) break; // 确定插入位置
i ++;
}
for( j = 6; j >= i+1; j-- ) //如果写成 for(j=i+1;j<=6;j++)不行,为什么不行下边会有解释
{
a[j+1] = a[j]; // 元素后移
}
a[i+1] = x; // 插入元素 x
printf("\n");
printf("插入后的数组为:\n");
for(cc; cc <=7; cc++) printf("%d ", a[cc]); // 查看是否插入成功
return 0;
}
int main(void)
{
ListIn(4);
}