Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
139438 邹文浠白云六中 扫雷游戏 C++ 解答错误 0 1 MS 336 KB 580 2024-03-23 17:24:59

Tests(0/10):


#include <bits/stdc++.h> using namespace std; int x[8] = {1,0,-1,0,1,-1,1,-1}; int y[8] = {0,1,0,-1,-1,1,-1,1}; int n,m,b[110][110]; char a[110][110]; int main() { ios::sync_with_stdio(0); memset(b,0,sizeof(b)); int n,m; cin >> n >> m; for(int i = 0;i < n;i++) for(int j = 0;j < m;j++) cin >> a[i][j]; for(int i = 0;i < n;i++) for(int j = 0;j < m;j++) for(int h = 0;h < 8;h++) if(a[i + x[h]][j + y[h]] == '*') b[i][j]++; for(int i = 0;i < n;i++) { for(int j = 0;j < n;j++) cout << b[i][j]; cout << '\n'; } }


测评信息: