Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <vector>
- #include <iostream>
- #include <algorithm>
- #include <cmath>
- #include <string>
- #include <set>
- #include <map>
- #include <iomanip>
- #include <time.h>
- #include <stdlib.h>
- using namespace std;
- #define re return
- #define pb push_back
- #define eb emplace_back
- #define all(x) (x).begin(), (x).end()
- #define fi first
- #define se second
- #define sqrt(x) sqrt(abs(x))
- #define pi (3.14159265358979323846264338327950288419716939937510)
- #define unique(v) v.resize(unique(all(v)) - v.begin())
- #define bipbup ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
- typedef vector<int> vi;
- typedef vector<vi> vvi;
- typedef pair<int, int> ii;
- typedef vector<ii> vii;
- typedef vector<string> vs;
- typedef double D;
- typedef long double ld;
- typedef long long ll;
- typedef pair<ll, ll> pll;
- typedef vector<ll> vll;
- typedef unsigned long long ull;
- bool myPred(int x, int y)
- {
- x = abs(x) % 10;
- y = abs(y) % 10;
- return x < y;
- }
- int main()
- {
- vi v;
- int num;
- while (cin >> num)
- v.push_back(num);
- sort(all(v), myPred);
- for (int i = 0; i < v.size(); i++)
- cout << v[i] << ' ';
- }
- /// 19 11 24 38 33 77 22 33 95 24 76 88 - 19 11 24 38 33 77 22 33 95 24 76 88
Add Comment
Please, Sign In to add comment