09/01/09 00:58:13
>>468
#include<iostream>
#include<string>
#include<map>
int main() {
char str[5][10] = {"home", "arow", "abec","bobo", "dummy"};
typedef std::map<std::string, int> Map;
Map m;
for (int i = 0; i < 5; i ++)
m.insert(Map::value_type(str[i], i));
for (Map::const_iterator it = m.begin(); it != m.end(); ++ it)
std::cout << it->second << ":" << it->first << std::endl;
return 0;
}