Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
102884 万隽宇 扫雷游戏 C++ Wrong Answer 5 MS 284 KB 947 2024-12-26 18:27:11

Tests(3/10):


Code:

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int n,m,d=0,h[8]={-1,-1,-1,0,0,1,1,1},l[8]={-1,0,1,-1,1,-1,0,1}; cin>>n>>m; const int M=m; const int N=n; char a[N+1][M+1]={}; 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++){ d=0; if(a[i][j]=='*') cout<<a[i][j]; else{ for(int k=0;k<=7;k++){ if(a[i+h[k]][j+l[k]]=='*') d++; }cout<<d; } } cout<<endl; } return 0; }


Run Info:

------Input------
40 30 ???*?*???*?????????*?*??*??*?? ?????*?????????*???*?*???????? *???*?*?**?????????*??*?**?*?* *?????????????*???????**?????* ???*?????*???*???????????????* ?????**?????*?*??????*?**?*?** ??????**??*?*????????*??*??*?? ***???????????**??**??????*??* ???????**???*?*???????**?????? ?**??**????*????????*???**???? *?**?????*?*?????*?????????*?? *?????*???????***??*?????**??? ????*?*??*????????*??????????* ??*??????????**??*???????*?*?? ?*????*???**?*???????**???*??* ??*????????*?*?**?*?????*???*
------Answer-----
001*3*201*100011102*4*21*11*10 11124*323320001*103*5*33333231 *201*3*2**100122102*33*4**2*3* *2122212332012*1001112**32214* 111*22211*112*320000124432124* 00112**32223*4*100002*3**3*3** 232113**11*3*43311223*33*43*43 ***10134321324**11**223322*22* 3542123**112*3*3112322**332111 2**32**3323*32111111*223**2110 *5**23321*3*21233*222101344*10 *32323*2223111***33*10001**221 1212*3*21*10134433*2100023422* 12*2132212323**11*2112211*3*32 1*3201*101**5*5333211**223*33* 12*10111125*5*4**2*23443*212*2 1233
------Your output-----
012*3*201*100011102*4*21*11*10 11124*323320001*103*5*33333231 *201*3*2**100122102*33*4**2*3* *2122212332012*1001112**32214* 111*22211*112*320000124432124* 00112**32223*4*100002*3**3*3** 232113**11*3*43311223*33*43*43 ***10134321324**11**223322*22* 3542123**112*3*3112322**332111 2**32**3323*32111111*223**2110 *5**23321*3*21233*222101344*10 *32323*2223111***33*10001**221 1212*3*21*10134433*2100023422* 12*2132212323**11*2112211*3*32 1*3201*101**5*5333211**223*33* 12*10111125*5*4**2*23443*212*2 1233