fork download
  1. #include <iostream>
  2. using namespace std;
  3. int x,y;
  4. int state[4][4];
  5. int swap(int state[4][4], int x, int y){
  6. int tmp;
  7. tmp = state[x][y-1];
  8. state[x][y-1] = state[x][y];
  9. state[x][y] = tmp;
  10. return y++;
  11. }
  12. int main(void){
  13. cin >> x >> y;
  14. for(int i = 0; i < 4; i++){
  15. for(int j = 0; j < 4; j++){
  16. cin >> state[i][j];
  17. }
  18. }
  19. swap(state, x, y);
  20. }
Success #stdin #stdout 0s 3296KB
stdin
2 3
 2  3  4  5                               
 6  7  8  1
 9 10 11 12
13 14 15 16
stdout
Standard output is empty