向有序数组中插入一个数,保持原顺序不变,将新数组输出

日期:2016-01-13 00:39:47 人气:1

向有序数组中插入一个数,保持原顺序不变,将新数组输出

//#include "stdafx.h"//If the vc++6.0, with this line.#include "stdio.h"int main(void){ int a[10]={1,3,5,6,7,8,9},t=4,i; for(i=6;i>=0;i--){ if(t>a[i]){ a[i+1]=t; break; }
    A+
热门评论