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 |
第N道递归题,呵呵,发贴同祝In Reply To:第一道搜索题 发帖庆祝 Posted by:bingbing at 2009-02-28 18:46:45 int Cal(int i, int j) { if (i<0 || i>row-1 || j<0 || j>col-1 || map[i][j] == '.') { return 0; } map[i][j] = '.'; return 1 + Cal(i,j-1) + Cal(i, j+1) + Cal(i-1, j) + Cal(i+1, j); } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator