| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
深搜,终于100道了。。。// #include<iostream>
//
// using namespace std;
//
// const int MAX_SIZE=21;
// char rb[MAX_SIZE][MAX_SIZE];
//
//
// int a[4]={1,0,0,-1};
// int b[4]={0,1,-1,0};
// int cnt;
// void search(int x0,int y0)
// {int i,x,y;
// cnt++; rb[x0][y0]='X';
// for (i=0;i<4;i++)
// { x=x0+a[i]; y=y0+b[i];
// if(x>=0&&y>=0&&rb[x][y]=='.')
// search(x,y);
// }
//
// }
//
// int main()
// {int x0,y0,m,n,i,j;
//
// while (cin>>m>>n)
// { if(m==0&&n==0) break;
// cnt=0;
// memset(rb,' ',sizeof(rb));
// for (i=0;i<n;i++)
// for (j=0;j<m;j++)
// {cin>>rb[i][j];
// if(rb[i][j]=='@') {x0=i;y0=j;}
// }
//
// search(x0,y0);
// cout<<cnt<<endl;
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator