Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <deque>
- #include <string>
- #include <windows.h>
- #include <cstdlib>
- #include <algorithm>
- #include <functional>
- using namespace std;
- int main()
- {
- SetConsoleCP(1251);
- SetConsoleOutputCP(1251);
- int i = 0;
- int u = 0;
- const int dequeSize = 10;
- //Первый дек
- std::deque<int> myDeque(dequeSize);
- cout << "Введите элементы дека" << endl;
- for (i = 0; i<dequeSize; i++)
- {
- cout << "Введенный дек [" << i << "] = ";
- while(!(cin>>myDeque[i]))
- {
- cout<<"~~~~~~~~~~~~~"<<endl;
- cout<<"ОШИБКА"<<endl;
- cout<<"Введите число: ";
- cout<<endl<<endl<<endl<<endl;
- cin.clear();
- cin.sync();
- }
- }
- for (i = 0; i < (dequeSize - 1); i++)
- if (myDeque[i] > myDeque[i + 1])
- break;
- if (i == (dequeSize - 1)){
- cout << "Sorted";
- }else{
- cout << "Not Sorted";
- }
- //////Проблема Здесь//////
- while(!(i == (dequeSize - 1))){
- cout << "Введите элементы дека" << endl;
- for (i = 0; i<dequeSize; i++)
- {
- cout << "Введенный дек [" << i << "] = ";
- while(!(cin>>myDeque[i]))
- {
- cout<<"~~~~~~~~~~~~~"<<endl;
- cout<<"ОШИБКА"<<endl;
- cout<<"Введите число: ";
- cout<<endl<<endl<<endl<<endl;
- cin.clear();
- cin.sync();
- }
- }
- }
- while(!(i == (dequeSize - 1))){
Add Comment
Please, Sign In to add comment