摘要:
题目不难,就是有点麻烦。会用到栈。#include #include struct _r { int a[30]; int x;}r[30];int n;// 判断a, b是否在同一堆中int pos(int a) { for (int i=0; i<n; i++) { ... 阅读全文
摘要:
用DFS把相邻的@字符标记掉,并统计块的个数就好了。#include int m, n;char map[105][105];int dir[8][2] = {-1, -1, -1, 0, -1, 1, 0, -1, // 定义8个方向数组 0, 1, 1... 阅读全文