#pragma warning(disable:4876)
#include<iostream>
#include<string>
#include<map>
using namespace std;
typedef map<int ,string , less<int> > INT2STRING;
void main()
{
INT2STRING theMap;
INT2STRING::iterator theIterator;
string theString="";
int index;
theMap.insert(INT2STRING::value_type(0,"zero"));
theMap.insert(INT2STRING::value_type(1,"one"));
theMap.insert(INT2STRING::value_type(2,"two"));
theMap.insert(INT2STRING::value_type(3,"three"));
theMap.insert(INT2STRING::value_type(4,"four"));
theMap.insert(INT2STRING::value_type(5,"five"));
theMap.insert(INT2STRING::value_type(6,"six"));
theMap.insert(INT2STRING::value_type(7,"seven"));
theMap.insert(INT2STRING::value_type(8,"eight"));
theMap.insert(INT2STRING::value_type(9,"nine"));
for( ; ;)
{
cout<<"Enter \"q\" to quit,or enter a Number:";
cin>>theString;
if(theString=="q")
break;
for(index=0;index<theString.length ();index++)
{
theIterator!=theMap.find(theString[index]-'0');
if(theIterator!=theMap.end())
cout<<(*theIterator).second<<" ";
else
cout<<"[err]";
}
cout<<endl;
}
}
提示遇到问题需要关闭是什么意思啊