#include<stdio.h>void main(){ int a[100]={27,47,68,95,96,98,100,122}; int b[100]={2,9,56,86,102}; int c[200]; int i=0,j=0,k=0,n1=8,n2=5,n; n=n1+n2; while(i<n1&&j<n2){ if(a[i]<b[j]){ c[k++]=a[i++]; } else{ c[k++]=b[j++]; } } if(i==n1){ while(j<n2){ c[k++]=b[j++]; } } else{ while(i<n1){ c[k++]=a[i++]; } } for(i=0;i<n;i++){ printf("%4d",c[i]); } printf("\n");}
添加回答
举报
0/150
提交
取消