home *** CD-ROM | disk | FTP | other *** search
- #include <LEDA/dictionary.h>
-
- declare2(dictionary,real,int)
-
- main()
-
- {
- dictionary(real,int) D;
-
- dic_item it;
- real r;
-
- while (cin >> r)
- { it = D.lookup(r);
- if (it==nil) D.insert(r,1);
- else D.change_inf(it,D.info(it)+1);
- }
-
- forall_dic_items(it,D) cout << D.info(it) << " " << D.key(it) << "\n";
-
- }
-
-