/{L} Generators #include
Автор admin
Понедельник, 1 июня 2009 11:32
/{L} Generators #include #include #include #include “Generators.h” #include “PrintSequence.h” using namespace std: struct Isupper { bool operator()(char c) { return isupper(c): } }: int mainO { string v: v.resize(25): generated. beginO. v.endO. CharGenO): print(v.beginO. v.endO, “v original”. “”); // Создание набора символов на базе v: string us(v.beginO. v.endO): sort (us. beginO. us.endO); string::iterator it = us.beginO. cit = v.endO. uend = unique(us.beginO. us.endO); // Перебор и удаление всего содержимого: while(it != uend) { cit = remove(v.beginO. cit. *it): print(v.beginO, v.endO. “Complete v”, “”): print(v.beginO. cit. “Pseudo v “. ” “): cout « “Removed element:\t” « *it « “\nPseudo Last Element:\t” « *cit « endl « endl; 304 Глава 6 • Обобщенные алгоритмы it++; } generated.beginO. v.endO. CharGenO); print(v.beginO. v.endO. “v”. “”): cit = remove_if(v.beginO. v.endO. IsUpperO); print(v.beginO. cit. “v after removejif IsUpper”. ” “); // Копирующие версии remove и remove_if не показаны. sort(v.beginO. cit): print(v.beginO. cit. “sorted”. ” “); string v2: v2.resize(cit
Теги: net
Комментарии закрыты.
Автор admin Понедельник, 1 июня 2009 11:32
/{L} Generators #include
Комментарии закрыты.
Последние комментарии