Satrli toifadagi vektor berilgan. Bir XIL qiymatdagi elementlarni aniqlang, ekranga chiqaring
Download 27.01 Kb.
|
MTA
1-amaliyot Satrli toifadagi vektor berilgan. Bir xil qiymatdagi elementlarni aniqlang, ekranga chiqaring. #include #include #include using namespace std; void fank(const vector set set for (int element : vec) { if (meet.count(element) > 0) { fank.insert(element); } else { meet.insert(element); } } if (!fank.empty()) { cout << "Bir xil qiymatli: "; for (int element : fank) { cout << element << " "; } cout < cout << "bir xil qiymatlani chiqaring:" << endl; } } int main() { vector fank(numbers); return 0;
int main() { int n; int b; cout << "O'nlik sonini kiriting: "; cin >> n; cout << "Bazani kiriting (2-16): "; cin >> b; cout << "Konvertatsiya qilingan soni: "; (n, b); return 0; } 6-amaliyot set — to‘plam doir misol ishlash #include #include using namespace std; int main() { set fank.insert(5); fank.insert(2); fank.insert(8); fank.insert(1); cout << "Elementlarni kiritish:"; for (const auto & num :fank) { cout << " " << num; } cout < if (fank.count(searchNum) > 0) { cout << searchNum << " to'plamda mavjud." << endl; } else { cout << searchNum << " to'plamda mavjud emas." << endl; } int removeNum = 2; fank.erase(removeNum); cout << "Yangilangan elementlar:"; for (const auto& num : fank) { cout << " " << num; } cout < } 8. Ro’yhat nusxasini yarating. #include #include using namespace std; int main() { list list cout << "Asl ro'yxat: "; for (const auto& element : originalList) { cout << element << " "; } cout < for (const auto& element : copiedList) { cout << element << " "; } cout < } 4. Download 27.01 Kb. Do'stlaringiz bilan baham: |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling