fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int x[] = {10,20,30,40};
  6. int y[] = {10,20,30,40};
  7. int *a = &x[0];
  8. int *b = &y[0];
  9. a++;
  10. ++*b;
  11. *a++;
  12. b++;
  13. a++;
  14. *a = *(--b) + (*a--);
  15. b++;
  16. *b = *(--a) + (++*b);
  17. for (int i= 0; i<4; i++)
  18. {
  19. cout<<x[i]<<" ";
  20.  
  21. }
  22. cout<<"\n";
  23. for (int i= 0; i<4; i++)
  24. {
  25. cout<<y[i]<<" ";
  26.  
  27. }
  28. cout<<"\n";
  29. // your code goes here
  30. return 0;
  31. }
Success #stdin #stdout 0s 16048KB
stdin
Standard input is empty
stdout
10 20 51 40 
11 41 30 40