swap_ranges(vl.beginO, vl.beg

Автор admin Среда, 27 мая 2009 11:32

swap_ranges(vl.beginO, vl.beginO + half. vl. beginO + half); print(vl.beginO, vl.endO. “swap_ranges”. ” “); // Сгенерировать интервал заново: generate(vl.beginO. vl.endO. SkipGenO); printCvl.beginO. vl.endO. “vl”. ” “); int third = vl.sizeO / 3: for(int i = 0: i < 10; i++) { rotateCvl.beginO, vl.beginO + third. vl.endO); printCvl.beginO. vl.endO. “rotate”. ” “); } cout « “Second rotate example:” « endl; char c[] = “aabbccddeeffgghhiijj”; const char CSZ = strlen(c); for(int i – 0; i < 10: i++) { rotate(c. с + 2. с + CSZ); print(c, с + CSZ. “”. “”): } cout « “All n! permutations of abed:” « endl; int nf = 4 * 3 * 2 * 1; char p[] = “abed”: for(int i = 0; i < nf; i++) { next_permutation(p. p + 4); print(p. p + 4, “”. “”); } cout « “Using prev_permutation:” « endl; for(int i = 0; i < nf; i++) { prev_permutation(p. p + 4): print(p. p + 4. “”. “”); } cout « “random_shuffling a word:” « endl; string sC’hello”): cout « s « endl; for(int i = 0; i < 5; i++) { random_shuff1e(s.beginО, s.end()): cout « s « endl; } NString sa[] = { “a”, “b”. “c”. “d”. “a”, “b”. “c”, “d”. “a”, “b”. “c”. “d”. “a”, “b”. “c”}; const int


Комментарии закрыты.