1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
#include <iostream>
#include <sstream>
#include <string>
#include <map>
using namespace std;
int main()
{
map<string,string> carMap = { { "0001", "motor" },
{ "0002", "Car trailer" },
{ "0003", "TwoAxleLong" },
{ "0004", "Buses" },
{ "0005", "TwoAxleSixTire" },
{ "0006", "ThreeAxleSingle" },
{ "0007", "FourAxleDouble" },
{ "0008", "FourAxleDouble" },
{ "0009", "TwoAxleLong" },
{ "0010", "SixAxle double" },
{ "0011", "SixAxle double" },
{ "0012", "SixAxleMulti" },
{ "0013", "Bicycle" },
{ "0014", "Not Classified" } };
istringstream iss( "0003 0004 0012" );
string s;
while ( iss >> s ) cout << s << ": " << carMap[s] << '\n';
}
|