Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
3687 | 杨洋杰 | 扫雷游戏 | C++ | Accepted | 1 MS | 276 KB | 598 | 2024-06-22 18:15:02 |
#include<bits/stdc++.h> using namespace std; bool a[105][105]; int main(){ memset(a,0,sizeof(a)); int n,m; char t; cin>>n>>m; for(int i=1;i<=n;i++){ for(int j=1;j<=m;j++) { cin>>t; if(t=='*') a[i][j]=1; } } for(int i=1;i<=n;i++){ for(int j=1;j<=m;j++){ if(a[i][j]==1) printf("*"); else{ printf("%d",a[i+1][j+1]+a[i+1][j-1]+a[i+1][j]+a[i][j+1]+a[i][j-1]+a[i-1][j+1]+a[i-1][j]+a[i-1][j-1]); } } printf("\n"); } return 0; }