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

我的代码第一次贴,希望喜欢,仅供参考(当然是A的..)

Posted by slon at 2011-02-11 18:23:36 on Problem 3364
#include <stdio.h>
int main()
{
	int n,m,c,a,b;
	while(scanf("%d%d%d",&m,&n,&c)!=EOF)
	{
		if(!n&&!m&&!c) break;
		a=m-7;
		if(m<8) a=0;
		b=n-7;
		if(n<8) b=0;
		printf("%d\n",c?(a*b+1)/2:a*b/2);  //不管黑白,一律除以2..右下角是白色的多加个1.
	}
	return 0;
}

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