Home > Back-end >  Bosses, ask a mapping problem
Bosses, ask a mapping problem

Time:10-27

In c + + traversal output, you can use the c printf () function to realize the output?

CodePudding user response:

 int main () 
{
Int t;
Map Dict.
Dict (" Tom ")=156554648;
Dict [" which Jony "]=14545649;
T=dict. The size ();
Map : : iterator it;
For (it=dict. The begin (); it!=dict. End (); It++)
Printf (" % s - & gt; % d \ n ", it - & gt; First. C_str (), it - & gt; Second);
return 0;
}

CodePudding user response:

reference 1/f, Michael amin's reply:
 int main () 
{
int t;
Map Dict.
Dict (" Tom ")=156554648;
Dict [" which Jony "]=14545649;
T=dict. The size ();
Map : : iterator it;
For (it=dict. The begin (); it!=dict. End (); It++)
Printf (" % s - & gt; % d \ n ", it - & gt; First. C_str (), it - & gt; Second);
return 0;
}

Thank you thank you, I know