按了按键之后没有交换
```c++
#include <iostream>
#include <string>
#define N 3
using namespace std;
class game{
private:
int a[N][N] = {0};
int i, j;
public:
void set(){
// int i, j;
for(i = 0; i < N; i++)
{
for(j = 0; j < N; j++)
{
cin >> a[i][j];
}
}
}
void display(){
// int i, j;
for(i = 0; i < N; i++)
{
for(j = 0; j < N; j++)
{
if(a[i][j] == 0)
{
cout << " ";
}
else
{
cout << a[i][j] << " ";
}
}
cout << "\n";
}
}
void move(){
char in = 0;
// int i, j;
char t = 0;
for(i = 0; i < N; i++)
{
for(j = 0; j < N; j++)
{
if(a[i][j] == 0)
{
break;
}
}
}
cin >> in;
if(in == 'a'){
t = a[i][j];
a[i][j] = a[i][j+1];
a[i][j+1] = t;
}
else if(in == 'd'){
t = a[i][j];
a[i][j] = a[i][j-1];
a[i][j-1] = t;
}
else if(in == 'w'){
t = a[i][j];
a[i][j] = a[i-1][j];
a[i-1][j] = t;
}
else if(in == 's'){
t = a[i][j];
a[i][j] = a[i+1][j];
a[i+1][j] = t;
}
}
};
int main()
{
game a;
a.set();
a.display();
while(1){
a.move();
a.display();
//TODO
}
return 0;
}
```