摘要:
第一种最简单:利用STL的set容器#include <set>using namespace std;class IntSet {public: IntSet(int no, int maxval):no_(no), maxval_(maxval) {} int size() {return s_.size();} void generate() { while(s_.size() < no_) { s_.insert((rand() + 100)%maxval_); } } void disp() { set<int>::const_iterator it; 阅读全文
posted @ 2009-02-16 20:37
小 楼 一 夜 听 春 雨
阅读(848)
评论(0)
推荐(0)

浙公网安备 33010602011771号