c++第六次实验

来源:互联网 发布:上古卷轴5 初始python 编辑:程序博客网 时间:2024/06/06 15:04
#include<iostream>using namespace std;int main(){int A[5]={1,3,8,9,10},B[5]={2,7,4,5,6},C[10];int a,b,c,t,e;for(a=c=0;a<5;a++,c++)C[c]=A[a];for(b=0;b<5;b++,c++)C[c]=B[b];for(c=0;c<9;c++){for(e=0;e<9-c;e++){if(C[e]>C[e+1]){t=C[e];C[e]=C[e+1];C[e+1]=t;}}}for(c=0;c<10;c++)cout<<C[c]<<" ";return 0;}
原创粉丝点击