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++;++*b;*a++;b++;a++;
  10. *a = *(--b) + (*a--);
  11. b++;
  12. *b = *(--a) + (++*b);
  13. for (int i= 0; i<4; i++)
  14. {
  15. cout<<x[i]<<" ";
  16. cout<<y[i]<<" ";
  17. }
  18. // your code goes here
  19. return 0;
  20. }
Success #stdin #stdout 0s 15224KB
stdin
Standard input is empty
stdout
10 11 20 41 51 30 40 40