home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / library / dos / diverses / leda / prog / plane / persist.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-11-15  |  444 b   |  29 lines

  1. #include <LEDA/p_dictionary.h>
  2. #include <LEDA/list.h>
  3.  
  4. declare2(p_dictionary,int,string)
  5.  
  6. declare(list,p_dictionary(int,string))
  7.  
  8. main()
  9. {
  10.   p_dictionary(int,string) D;
  11.   p_dic_item it;
  12.  
  13.   int i,n = read_int("n = ");
  14.  
  15.   list(p_dictionary(int,string)) L;
  16.  
  17.   L.append(D);
  18.  
  19.   for(i = 1; i<n; i++) L.append(L.tail().insert(i,form(" -%d- ",i)));
  20.  
  21.  
  22.   forall(D,L) 
  23.   { forall_items(it,D)  cout << D.key(it) <<  D.inf(it) << " ";
  24.     newline;
  25.    }
  26.  
  27.  
  28. }
  29.