map<int,int,greater> result
#include <iostream>
using namespace std;
#include <map>
int main()
{
//map<int,int> result;
map<int,int,greater<int>> result;
for (int j=0;j<9;j++){
//result[j] = rand();
int ran = rand();
result[ran] = j; //机智的排序用法!!!
cout << ran << " " << j << " " <<endl;
//cout << << " ";
}
cout << "-----------------------------------" <<endl;
// for (int j=0;j<9;j++){
// cout << result[j] << " ";
// }
for (auto it=result.begin();it != result.end();it++)
{
cout << it->first << " " << it->second << " " ;
//cout << it->second << " " ;
}
cout << endl;
return 0;
}