帮我编个程序 怎么将一组c++关键字放到二维数组中,并找出这些关键字的最小者

来源:百度知道 编辑:UC知道 时间:2024/09/23 10:54:59
怎么将一组c++关键字放到二维数组中,并找出这些关键字的最小者

使用指针数组;

使用c的qsort,或者c++的sort

template <class RandomAccessIterator>
void sort ( RandomAccessIterator first, RandomAccessIterator last );

template <class RandomAccessIterator, class Compare>
void sort ( RandomAccessIterator first, RandomAccessIterator last, Compare comp );

<algorithm>

Sort elements in range

Sorts the elements in the range [first,last) into ascending order.

The elements are compared using operator< for the first version, and comp for the second.

Elements that would compare equal to each other are not guaranteed to keep their original relative order.

Parameters

first, last
Random-Access iterators to the initial and final positions of the sequence to be sorted. The range used is [first,last), which contains all the elements between first and last, including the element pointed by first but not the element pointed by las