Gravatar
10001
积分:70
提交:117 / 222
freopen("area0.in","r",stdin);freopen("area0.out","w",stdout);
int ll=0;
cin>>a>>b;
for(int z=1;z<=a;z++)
for(int y=1;y<=b;y++)
cin>>u[z][y];
i(0,0);
for(int z=1;z<=a;z++)
for(int y=1;y<=b;y++)
{
if(u[z][y]=='0')
ll++;}
cout<<ll;
}

Gravatar
10001
积分:70
提交:117 / 222
#include<bits/stdc++.h>
using namespace std;
char u[102][102];
int a,b;
void i(int x,int y)
{
u[x][y]='^';
if((u[x][y+1]=='0'||u[x][y+1]==0)&&y<=b)
i(x,y+1);
if((u[x+1][y]=='0'||u[x+1][y]==0)&&x<=a)
i(x+1,y);
if((u[x][y-1]=='0'||u[x][y-1]==0)&&y>=1)
i(x,y-1);
if((u[x-1][y]=='0'||u[x-1][y]==0)&&x>=1)
i(x-1,y);
}
int main()
{

Gravatar
Foenix
积分:1029
提交:371 / 853
@CAX_CPG 大神求代码

Gravatar
digital-T
积分:2213
提交:586 / 1311
CAX大神求算法