- #include <map>
- #include <iostream>
- using namespace std;
- void main()
- { map<char*,float> m;
- m["apple"] = 8.6f;
- m["orangle"] = 3.2f;
- m["banana"] = 2.8f;
- m["pear"] = 3.8f;
- m["lichee"] = 7.6f;
- m["barry"] = 8.2f;
- cout<<"苹果"<<m["apple"]<<"元/斤\\n";
- //该片段来自于http://www.codesnippet.cn/detail/1410201410610.html
来源: http://www.codesnippet.cn/detail/1410201410610.html