我需要从控制台读取这些数据,但这很奇怪。请检查一下,因为我被困了几个小时。提前致谢。问题是,变种 smer 有疯狂内容或根本没有。
3
3 5
2 2 S
8
DPLDLPDD
2 4 Z
7
PDDPDPD
2 1 J
8
PPDLDDDD
这是我的阅读代码
int N;
scanf("%d", &N);
for (int g = 0;g < N; g++)
{
int velX, velY;
scanf("%d %d", &velX, &velY);
int x, y;
char smer = 'A';
scanf("%d %d %c", &x, &y, &smer); getchar();
int D;
scanf("%d", &D); //getchar();
bool killed = false;
int oldX = x, oldY = y;
string dstr;
for (int i = 0; i < D; i++)
{
char c;
scanf("%c", &c);
...
...
...
}
getchar();
}