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

帮忙看看,自己运行没问题,但是提交就WA了!~~~

Posted by 2007210562 at 2008-11-06 11:18:11 on Problem 1067
In Reply To:有循环!!!~~~ Posted by:2007210562 at 2008-11-06 11:16:04
> 
> 都是循环的,a-13*i,b-21*i  例如14-13=1,23-21=2,结果(1,2)
> 16-13=3,26-21=5,结果(3,5)
>#include <stdio.h>
void main ()
{
	int m;
	long j,a,b;
	while (scanf ("%ld%ld",&a,&b)==2)
	{ 
		  if (a<b)
	     {
          j=b;b=a;a=j;
         }
         while (a>21)
         {
          a=a-21;
          b=b-13;
         }
    if ((a==2&&b==1)||(a==5&&b==3)||(a==7&&b==4)||(a==10&&b==6)||(a==13&&b==8)||(a==15&&b==9)||(a==18&&b==11)||(a==20&&b==12))
		m=0;
    else 
		m=1;
	printf ("%d\n",m);
	}
}

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