Advertisement
dllbridge

Untitled

Nov 8th, 2022
895
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.71 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int b, a[31], c[40], d[40], we, wy;
  5.  
  6. ///////////////////////////////
  7. int main()                  //
  8. {
  9.   cin >> b;
  10.  
  11.   for(int i = 0; i < b; i++) cin >> a[i];
  12.  
  13.   for(int i = 0; i < 31; i++)
  14.         if(a[i] % 2 == 0) c[i] = a[i];
  15.        
  16.   for(int i = 0; i < 31; i++)
  17.         if(a[i] % 2 != 0) d[i] = a[i];
  18.        
  19.        
  20.   for(int i = 0; i < 10; i++) if(d[i] != 0)
  21.   {
  22.         cout << d[i] << " ";  
  23.         we++;
  24.   }
  25.  
  26.         cout << endl;
  27.  
  28.   for(int i = 0; i < 10; i++) if(c[i] != 0)
  29.   {
  30.         cout << c[i] << " ";
  31.         wy++;
  32.   }  
  33.        
  34.  cout << endl;
  35.  
  36.  if(wy > we)
  37.         cout << "YES";
  38.  else
  39.         cout << "NO";
  40.  
  41. }
  42.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement