(1, 40));
gquiz1.insert(pair(2, 30));
gquiz1.insert(pair(3, 60));
gquiz1.insert(pair(4, 20));
gquiz1.insert(pair(5, 50));
gquiz1.insert(pair(6, 50));
gquiz1.insert(pair(7, 10));
map::iterator itr;
cout << "\ngquiz1 mapi : \n";
cout << "\tKALIT\tELEMENT\n";
for (itr = gquiz1.begin(); itr != gquiz1.end(); ++itr) {
cout << '\t' << itr->first
<< '\t' << itr->second << '\n';
}
cout << endl;
map gquiz2(gquiz1.begin(), gquiz1.end());
cout << "\ngquiz2 mapidan keyin" << "gquiz1 ning nusxasi: \n";
cout << "\tKALIT\tELEMENT\n";
for (itr = gquiz2.begin(); itr != gquiz2.end(); ++itr) {
cout << '\t' << itr->first << '\t' << itr->second << '\n';
}
cout << endl;
cout << "\ngquiz2 kalit = 3 dan kam elementlarni olib tashlangandan keyin : \n";
cout << "\tKALIT\tELEMENT\n";
gquiz2.erase(gquiz2.begin(), gquiz2.find(3));
for (itr = gquiz2.begin(); itr != gquiz2.end(); ++itr) {
cout << '\t' << itr->first
<< '\t' << itr->second << '\n';
}
int num;
num = gquiz2.erase(4);
cout << "\ngquiz2.erase(4) : ";
cout << num << " removed \n";
cout << "\tKALIT\tELEMENT\n";
for (itr = gquiz2.begin(); itr != gquiz2.end(); ++itr) {
cout << '\t' << itr->first << '\t' << itr->second << '\n';
}
cout << endl;
cout << "gquiz1.lower_bound(5) : " << "\tKALIT = ";
cout << gquiz1.lower_bound(5)->first << '\t';
cout << "\tELEMENT = " << gquiz1.lower_bound(5)->second << endl;
cout << "gquiz1.upper_bound(5) : " << "\tKALIT = ";
cout << gquiz1.upper_bound(5)->first << '\t';
cout << "\tELEMENT = " << gquiz1.upper_bound(5)->second << endl;
return 0;
}