fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int n; cin>>n;
  6. int arr[10000];
  7. cout<<"the even numbers"<<endl;
  8. cout<<"................."<<endl;
  9. for(int i=0;i<n;i++){
  10. cin>>arr[i];
  11. if(arr[i]%2==0){
  12. cout<<arr[i]<<endl;
  13. }
  14.  
  15. }
  16. cout<<"the odd numbers"<<endl;
  17. cout<<"................."<<endl;
  18. for(int i=0;i<n;i++){
  19. if(arr[i]%2!=0){
  20. cout<<arr[i]<<endl;
  21.  
  22. }
  23. }
  24. return 0;
  25. }
Success #stdin #stdout 0s 4272KB
stdin
5
1 2 3 4 5
stdout
the even numbers
.................
2
4
the odd numbers
.................
1
3
5