Question
Two friends Niya and Druva visited a math’s magic zone. They had decided to play a puzzle game that asked them to alternate the order of Negative numbers and perfect square numbers. By using a quick sort algorithm and some rearranging logic to help them do the task. Identify the approach used by them to play the game and implement a C++ program with STL libraries. Don’t use arrays and sort algorithms for this program.
Sample Input
[-1, -3, 8, 12, -4, 4, 9, -7, 19, 25, 16]
Sample Output
[-3, 16, -7, 4, -1, 9, -4, 25]
#include #include #include using namespace std; void show(const vector &arr, const string &msg = "") { cout
Источник: https://stackoverflow.com/questions/780 ... -c-sorting
Проблемы с поиском правильного алгоритма для получения вывода, C++, сортировка ⇐ C++
Программы на C++. Форум разработчиков
1709395092
Anonymous
[b]Question[/b]
Two friends Niya and Druva visited a math’s magic zone. They had decided to play a puzzle game that asked them to alternate the order of Negative numbers and perfect square numbers. By using a quick sort algorithm and some rearranging logic to help them do the task. Identify the approach used by them to play the game and implement a C++ program with STL libraries. [b]Don’t use arrays and sort algorithms for this program.[/b]
[b]Sample Input[/b]
[-1, -3, 8, 12, -4, 4, 9, -7, 19, 25, 16]
[b]Sample Output[/b]
[-3, 16, -7, 4, -1, 9, -4, 25]
#include #include #include using namespace std; void show(const vector &arr, const string &msg = "") { cout
Источник: [url]https://stackoverflow.com/questions/78093292/trouble-finding-out-the-right-algorithm-to-get-the-output-c-sorting[/url]
Ответить
1 сообщение
• Страница 1 из 1
Перейти
- Кемерово-IT
- ↳ Javascript
- ↳ C#
- ↳ JAVA
- ↳ Elasticsearch aggregation
- ↳ Python
- ↳ Php
- ↳ Android
- ↳ Html
- ↳ Jquery
- ↳ C++
- ↳ IOS
- ↳ CSS
- ↳ Excel
- ↳ Linux
- ↳ Apache
- ↳ MySql
- Детский мир
- Для души
- ↳ Музыкальные инструменты даром
- ↳ Печатная продукция даром
- Внешняя красота и здоровье
- ↳ Одежда и обувь для взрослых даром
- ↳ Товары для здоровья
- ↳ Физкультура и спорт
- Техника - даром!
- ↳ Автомобилистам
- ↳ Компьютерная техника
- ↳ Плиты: газовые и электрические
- ↳ Холодильники
- ↳ Стиральные машины
- ↳ Телевизоры
- ↳ Телефоны, смартфоны, плашеты
- ↳ Швейные машинки
- ↳ Прочая электроника и техника
- ↳ Фототехника
- Ремонт и интерьер
- ↳ Стройматериалы, инструмент
- ↳ Мебель и предметы интерьера даром
- ↳ Cантехника
- Другие темы
- ↳ Разное даром
- ↳ Давай меняться!
- ↳ Отдам\возьму за копеечку
- ↳ Работа и подработка в Кемерове
- ↳ Давай с тобой поговорим...
Мобильная версия