正在加载图片...
66模报 (++ C+十 4+十 ++ void mian() a[]={4,3,4,5,8,%}; double d[9}={2.0,4.3,1.8,9.5}; sort(a,6);∥/对整型数进行排序 sort(d,9);∥对双精度实型进行排序 cout <<"n output sort for int a for(int 1=0; 1<6; 1++)cout <<a[i]<< cout <<"n output sort for double d for(intj=0; j<9: j++)cout<<di<< 结果: output sort for int a:3,4,4,5,8,9, output sort for double d: 0.0,0.0, 0.0 0.0.0.0.1.8.2.0.4.3.9.5void mian( ) { int a[ ]={4, 3, 4, 5, 8, 9}; double d[9]={2.0, 4.3, 1.8, 9.5}; sort(a, 6); //对整型数进行排序 sort(d, 9); //对双精度实型进行排序 cout << " \n output sort for int a: " for(int i=0; i<6; i++) cout << a[i] << " , "; cout << " \n output sort for double d: " ; for(int j=0; j<9; j++) cout << d[j] << ", "; } 结果: output sort for int a: 3, 4, 4, 5, 8, 9, output sort for double d: 0.0, 0.0, 0.0, 0.0, 0.0, 1.8, 2.0, 4.3, 9.5, §6.6 模板
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有