Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdlib>
  3. using namespace std;
  4.  
  5. int main() {
  6. const int n = 10;
  7.  
  8. int A[n] = { 3, 43, 54, 64, 0, 43, 60, 20, 100, 304};
  9. int B[n] = { 7, 2, 154, 11, 33, 70, 142, 500, 54, 4};
  10. int C[2*n];
  11.  
  12. for(int i = 0; i < n; i++) {
  13. C[i*2] = A[i];
  14. C[i*2+1] = B[i];
  15. }
  16.  
  17. for(int i = 0; i < 2 * n; i++){
  18. cout<<C[i]<<" ";
  19. }
  20.  
  21. cout<<endl;
  22.  
  23.  
  24. return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement