Home > Back-end >  To transform and sort of members of the map, will come in, please
To transform and sort of members of the map, will come in, please

Time:10-23

 # include 
#include
#include
#include
#include
#include

using namespace std;
Int criterion;//score

Pair{
If (p. econd & gt;=criterion)
Return the p;
}

Bool function2 (pair{
Return a.s econd & lt; B.s econd;
}

Int main ()
{
Int examinees.//the candidate number
Int question_n;//the topic for


While (cin & gt;> Examinees & amp; & Examinees!=0 & amp; & Cin & gt;> Question_n & gt;> Criterion)
{

Map Course;
Vector Que_cource;
int tmp;

//input subject score
While (question_n -!=0 & amp; & Cin & gt;> TMP)
Que_cource. Push_back (TMP);

While (examinees -!=0)
{
String name;//name
Int solve;//problem solving for


Cin & gt;> The name & gt;> Solve;
Course. Insert (make_pair (name, 0));

int n;
int sum=0;//total score
While (solve -!=0 & amp; & Cin & gt;> N)
{
The sum +=que_cource [n - 1);
}
//record the student score
Course [name]=sum;
}

//in line with the number of
Map Out;
The transform (course. The begin (), the course. The end (), back_inserter (out), once function1);

//order
Sort (out) the begin (), out. The end (), function2);

Map : : iterator iter=out. The begin ();
//output
Cout & lt; For (; Iter!=out. The end (); Iter++)
{
Cout & lt; }
}
return 0;
}


There is such a mistake:

1 & gt; -- -- -- -- -- - has started to generate: project: ranking, configuration: Debug Win32 -- -- -- -- -- --
1 & gt; Generate the start time for 2013/5/14 15:33:37,
1 & gt; InitializeBuildStatus:
1 & gt; Is the Debug \ "rankings. Unsuccessfulbuild" Touch mission,
1 & gt; ClCompile:
1 & gt; The main. CPP
1 & gt; E: \ \ Microsoft visual studio 10.0 vc \ include \ algorithm (3806) : error C2784: "_RanIt1: : difference_type STD: : operator - (STD: : move_iterator & lt; _RanIt & gt; & , const STD: : move_iterator & lt; _RanIt2 & gt; & amp;) ": from" failed to STD: : _Tree_iterator & lt; _Mytree & gt;" As "STD: : move_iterator & lt; _RanIt & gt; & amp;" Template parameter is derived
1 & gt; With
1 & gt;
1 & gt; _Mytree=STD: : _Tree_val & lt; STD: : _Tmap_traits & lt; STD: : string, int, STD: : less , STD: : allocator False>
1 & gt; ]
1 & gt; E: \ \ Microsoft visual studio 10.0 vc \ include \ iterator (344) : see "STD: : operator -" statement
1 & gt; E: \ visual studio 2010 in the seniority of the acm \ \ projects \ \, \ main CPP (63) : see a function template instantiation of are compiling "void STD: : sort (_RanIt _RanIt _Pr), "a reference to the
1 & gt; With
1 & gt;
1 & gt; _Mytree=STD: : _Tree_val & lt; STD: : _Tmap_traits & lt; STD: : string, int, STD: : less , STD: : allocator False> ,
1 & gt; _Ty1=STD: : string,
1 & gt; _Ty2=int,
1 & gt; _RanIt=STD: : _Tree_iterator & lt; STD: : _Tree_val & lt; STD: : _Tmap_traits & lt; STD: : string, int, STD: : less , STD: : allocator False>> ,
1 & gt; _Pr=bool (__cdecl *) (STD: : pair & , STD: : pair & amp;)
1 & gt; ]
1 & gt; E: \ \ Microsoft visual studio 10.0 vc \ include \ algorithm (3806) : error C2784: "_RanIt1: : difference_type STD: : operator - (STD: : move_iterator & lt; _RanIt & gt; & , const STD: : move_iterator & lt; _RanIt2 & gt; & amp;) ": from" failed to STD: : _Tree_iterator & lt; _Mytree & gt;" As "STD: : move_iterator & lt; _RanIt & gt; & amp;" Template parameter is derived
1 & gt; With
1 & gt;
1 & gt; _Mytree=STD: : _Tree_val & lt; STD: : _Tmap_traits & lt; STD: : string, int, STD: : less , STD: : allocator False>
1 & gt; ]
1 & gt; E: \ \ Microsoft visual studio 10.0 vc \ include \ iterator (344) : see "STD: : operator -" statement
1 & gt; E: \ \ Microsoft visual studio 10.0 vc \ include \ algorithm (3806) : error C2784: "_RanIt1: : difference_type STD: : operator - (STD: : move_iterator & lt; _RanIt & gt; & , const STD: : move_iterator & lt; _RanIt2 & gt; & amp;) ": from" failed to STD: : _Tree_iterator & lt; _Mytree & gt;" As "STD: : move_iterator & lt; _RanIt & gt; & amp;" Template parameter is derived
1 & gt; With
1 & gt;
1 & gt; _Mytree=STD: : _Tree_val & lt; STD: : _Tmap_traits & lt; STD: : string, int, STD: : less , STD: : allocator False>
1 & gt; ]
1 & gt; E: \ \ Microsoft visual studio 10.0 vc \ include \ iterator (344) : see "STD: : operator -" statement
1 & gt; E: \ \ Microsoft visual studio 10.0 vc \ include \ algorithm (3806) : error C2784: "_RanIt1: : difference_type STD: : operator - (STD: : move_iterator & lt; _RanIt & gt; & , const STD: : move_iterator & lt; _RanIt2 & gt; & amp;) ": from" failed to STD: : _Tree_iterator & lt; _Mytree & gt;" As "STD: : move_iterator & lt; _RanIt & gt; & amp;" Template parameter is derived
1 & gt; With
1 & gt;
1 & gt; nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull