Advertisement
dllbridge

Untitled

Nov 8th, 2022
820
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.57 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int b, a[31], c[40], d[40];
  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(c[i] != 0)
  21.         cout << "Чётные"    << c[i] << endl;
  22.        
  23.   for(int i = 0; i < 10; i++) if(d[i] != 0)
  24.         cout << "Не чётные" << d[i] << endl;  
  25.  
  26.  
  27. }
  28.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement