Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- #include <ios>
- #include <string>
- #include <vector>
- #include <algorithm>
- using std::cin;
- using std::cout;
- using std::endl;
- using std::sort;
- using std::string;
- using std::vector;
- int main ()
- {
- cout << "Enter integers";
- vector<int> vec;
- int x;
- while (cin >> x)
- vec.push_back(x);
- typedef vector<int>::size_type vec_sz;
- vec_sz size = vec.size();
- if (size==0){
- cout << endl << "haha no" << endl;
- return 1;
- }
- int b;
- b = size / 4;
- int n;
- n = b;
- sort(vec.begin(), vec.end());
- while (0 < b){
- cout << vec[b] << endl;
- --b;
- }
- while (n < n + b){
- cout << vec[n+b] << endl;
- --b;
- }
- while (2*n < 2*n + b){
- cout << vec[2*n+b] << endl;
- --b;
- }
- while (3*n < 3*n + b){
- cout << vec[3*n+b] << endl;
- --b;
- }
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement