Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
3701 | 孙浚轩 | 扫雷游戏 | C++ | Compile Error | 0 MS | 0 KB | 812 | 2024-06-23 00:18:05 |
#include<iostream> using namespace std; int main(){ int n,m; cin>>n>>m; char mf[n+2][m+2]; memset(mf,0,sizeof(mf)); for(int i=1;i<=n;i++) for(int j=1;j<=m;j++) cin>>mf[i][j]; for(int i=1,cnt;i<=n;i++){ for(int j=1;j<=m;j++){ if(mf[i][j]=='*') cout<<"*"; else{ cnt=0; if(mf[i+1][j]=='*') cnt++; if(mf[i+1][j+1]=='*') cnt++; if(mf[i][j+1]=='*') cnt++; if(mf[i-1][j+1]=='*') cnt++; if(mf[i-1][j]=='*') cnt++; if(mf[i-1][j-1]=='*') cnt++; if(mf[i][j-1]=='*') cnt++; if(mf[i+1][j-1]=='*') cnt++; cout<<cnt; } } cout<<endl; } return 0; }
Main.cc: In function 'int main()': Main.cc:8:27: error: 'memset' was not declared in this scope memset(mf,0,sizeof(mf)); ^