close

利用sort algorithm寫一個排序範例.....

數位高手(NBP)

#include <vector>
#include <algorithm>  // Include algorithms
using namespace std;

vector<int> vec;
vec.push_back (10);
vec.push_back (3);
vec.push_back (7);

sort(vec.begin(), vec.end()); // Sort the vector

// The vector now contains: 3, 7, 10
 
>Parsed in 0.031 seconds, using GeSHi 1.0.6,數位高手(NBP)
arrow
arrow
    全站熱搜

    NBPBlog 發表在 痞客邦 留言(0) 人氣()