Beispiel: Wörter sortieren

#include <algorithm>
#include <list>
#include <string>
#include <iostream>
int main (int argc, char ** argv) {
  std::list<std::string> l;
  for ( std::string s ; std::cin >> s ; ) {
    l.push_back (s);
  }
  show (l); l.sort (); show (l); return 0;
}

beachte: Imports, Objekte, Methoden, generische Container, Namespaces ::, Operator >>



Johannes Waldmann 2005-06-08