文章

6

粉丝

369

获赞

1

访问

47.1k

头像
C语言解法
P1675 中南大学2017/中山大学2019年机试题
发布于2021年1月28日 16:34
阅读数 6.5k

#include<stdio.h>
typedef struct mg {
    char s;
    int flag;
}mg;
typedef struct dir {
    int x;
    int y;
}dir;
int main() {
    int w, h;
    int nextx, nexty;
    int id;
    dir d[4] = { {-1,0}, {0,1}, {1,0}, {0,-1} };
    while (scanf("%d %d", &w, &h) != EOF) {
        mg a[100][100];
        getchar();
        int startx = 0, starty = 0;
        for (int i = 0; i < w; i++) {
            for (int j = 0; j < h; j++) {
                scanf("%c", &a[i][j].s);
                a[i][j].flag = 0;
 ...

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发