#include<iostream> using namespace std; int main() { int n,k; int temp; int a[11]={1,4,6,9,11,13,35,44,46,50}; cout<<"原数组是:"<<endl; for(int p=0;p<10;p++) { cout<<a[p]<<" "; } cout<<endl; cout<<"please input an number:"<<endl; cin>>n; for(int i=0;i<11;i++) { if(a[i]<=n) { k=i; }else { break; } } temp=a[k]; for(int j=10;j>k+1;j--) { a[j]=a[j-1]; } a[k+1]=n; cout<<"插入的数字是"<<n<<endl; cout<<"插入数字后的数组变为:"<<endl; for(int q=0;q<10;q++) { cout<<a[q]<<" "; } return 0; }