/** =====================================================================================** Filename: StableSort.cpp** Description:** Version: 1.0* Created: 2017年03月02日 16时10分11秒* Last Modified: 2017年11月23日 10:50:06* Revision: none* Compiler: gcc** Author: zt (),* Organization:** =====================================================================================*/#include <stdio.h>#include <iostream>#include <algorithm>#include <vector>bool compare_as_ints ( double i, double j ){return ( int ( i ) < int ( j ) );}int main ( int argc, char* argv[] ){( void ) argc;( void ) argv;double mydoubles[] ={ 3.14, 1.41, 2.72, 4.67, 1.73, 1.32, 1.62, 2.58};std::vector<double> myvector;myvector.assign ( mydoubles, mydoubles + sizeof ( double ) );std::stable_sort ( myvector.begin(), myvector.end() );for ( auto& ele : myvector )std::cout << ' ' << ele;std::cout << std::endl;return 0;}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。