d_array.c
资源名称:leda.tar.gz [点击查看]
上传用户:gzelex
上传日期:2007-01-07
资源大小:707k
文件大小:0k
源码类别:
数值算法/人工智能
开发平台:
MultiPlatform
- #include <LEDA/d_array.h>
- void print(d_array<string,string> A) // by value
- { string s;
- forall_defined(s,A) cout << s << " " << A[s] << endl;
- newline;
- }
- main()
- {
- d_array<string,string> trans, D;
- trans["hello"] = "hallo";
- trans["world"] = "Welt";
- trans["book"] = "Buch";
- trans["coffee"] = "Kaffee";
- trans["hello"] = "xyz";
- D = trans;
- trans.undefine("hello");
- trans.undefine("world");
- print(D);
- print(trans);
- return 0;
- }