Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- using namespace std;
- int main() {
- int n, cnt1=0, cnt2=0;
- cin >> n;
- vector <int> a(n, 0);
- for (int i = 0; i<n; i++) {
- cin >> a[i];
- if (a[i]%2==0) {
- cnt1++;
- } else {
- cnt2++;
- cout << a[i] << " ";
- }
- } cout << endl;
- for (int i = 0; i<n; i++) {
- if (a[i]%2==0) {
- cout << a[i] << " ";
- }
- } cout << endl;
- if (cnt1>=cnt2) cout << "YES";
- else cout << "NO";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement