📅  最后修改于: 2022-03-11 14:56:29.199000             🧑  作者: Mango
#include using namespace std; int main(){ map m; int arr[] = {0,2,1,3,3,4,10,55,10}; int size = sizeof(arr)/sizeof(arr[0]); for(int i = 0 ; i < size ; i++){ m[arr[i]]++; } map::iterator itr; for(itr = m.begin() ; itr != m.end() ; itr++){ cout<<"Element: "<<(*itr).first<