Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

第N道递归题,呵呵,发贴同祝

Posted by gfedcba at 2009-02-28 19:21:48 on Problem 3051
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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator