Gravatar
10001
积分:70
提交:117 / 222
#include<iostream>
#include<cstdio>
using namespace std;
char a[101][101];
int b[101][101];
int main(){
freopen("2015mine.in","r",stdin);
freopen("2015mine.out","w",stdout);
int m,n;
cin>>m>>n;
for(int i=1;i<=m;i++){
for(int j=1;j<=n;j++){
cin>>a[i][j];
}
}
for(int i=1;i<=m;i++){
for(int j=1;j<=n;j++){
if(a[i][j]=='*'){
if(a[i+1][j]=='?')b[i+1][j]++;
if(a[i][j+1]=='?')b[i][j+1]++;
if(a[i-1][j]=='?')b[i-1][j]++;
if(a[i][j-1]=='?')b[i][j-1]++;
if(a[i+1][j+1]=='?')b[i+1][j+1]++;
if(a[i+1][j-1]=='?')b[i+1][j-1]++;
if(a[i-1][j-1]=='?')b[i-1][j-1]++;
if(a[i-1][j+1]=='?')b[i-1][j+1]++;
}
}
}
for(int i=1;i<=m;i++){
for(int j=1;j<=n;j++){
if(a[i][j]=='*'){
cout<<"*";
}else{
cout<<b[i][j];
}
}
cout<<endl;
}
return 0;
}回复 @羊凢 :

Gravatar
羊凢
积分:18
提交:8 / 17
#include<iostream>
#include<cstdio>
using namespace std;
char a[101][101];
int b[101][101];
int main(){
freopen("2015mine.in","r",stdin);
freopen("2015mine.out","w",stdout);
int m,n;
cin>>m>>n;
for(int i=1;i<=m;i++){
for(int j=1;j<=n;j++){
cin>>a[i][j];
}
}
for(int i=1;i<=m;i++){
for(int j=1;j<=n;j++){
if(a[i][j]=='*'){
if(a[i+1][j]=='?')b[i+1][j]++;
if(a[i][j+1]=='?')b[i][j+1]++;
if(a[i-1][j]=='?')b[i-1][j]++;
if(a[i][j-1]=='?')b[i][j-1]++;
if(a[i+1][j+1]=='?')b[i+1][j+1]++;
if(a[i+1][j-1]=='?')b[i+1][j-1]++;
if(a[i-1][j-1]=='?')b[i-1][j-1]++;
if(a[i-1][j+1]=='?')b[i-1][j+1]++;
}
}
}
for(int i=1;i<=m;i++){
for(int j=1;j<=n;j++){
if(a[i][j]=='*'){
cout<<"*";
}else{
cout<<b[i][j];
}
}
cout<<endl;
}
return 0;
}
暴力

Gravatar
Consciousness.M
积分:8
提交:6 / 20
回复 @hjf222289 :
呵呵呵呵呵呵呵呵呵呵呵呵呵呵 张函语真皮

Gravatar
张函语
积分:6
提交:6 / 24

天秀
陈独秀

Gravatar
2018noip必胜!
积分:137
提交:77 / 214
终于过了
我对不起江东父老

Gravatar
小字、小瓶子
积分:437
提交:175 / 311
暴搜。。。

Gravatar
hjf222289
积分:297
提交:123 / 413
回复 @xxx :
您的字号太大了,以至于很大程度上影响了他人的对题库的正常使用。请麻烦您将字号修改到正常大小,谢谢!

Gravatar
OhYee
积分:58
提交:19 / 91

Gravatar
宇智波瞎
积分:125
提交:77 / 478
复赛留念

Gravatar
gg
积分:64
提交:36 / 119
我很想知道今年普及组的分数会比去年高多少

Gravatar
@@@
积分:1120
提交:307 / 770
暴搜也能过