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

我运行了是正确的,但是就是不AC,各位帮看一下代码吧

Posted by gladystbc at 2010-02-25 01:33:33 on Problem 1067
#include "stdio.h"
int jy(int x,int y);
void main()
{
 int a[3],b[3],c[3],i;
 for(i=0;i<2;i++)
 {scanf("%d %d\n",&a[i],&b[i]);}
 scanf("%d %d",&a[i],&b[i]);
 for(i=0;i<3;i++)
 {c[i]=jy(a[i],b[i]);}
 for(i=0;i<3;i++)
 {printf("%d\n",c[i]);}
}
int jy(int x,int y)
{
	int t,z,m,js;
	if(x==y)z=1;
	else
	{
	  if(x<y)
	  {t=y;y=x;x=t;}
	  m=y%13;
	  switch(m)
	  {
		case 1:js=1;break;
		case 3:js=2;break;
		case 4:js=3;break;
		case 6:js=4;break;
		case 8:js=5;break;
		case 9:js=6;break;
		case 11:js=7;break;
		case 12:js=8;break;
		default:js=0;z=1;break;
	  }
	  if(js>0&&js<9)
	  {
	  	if(x!=(y+(y/13)*8+js)) z=1;
	    else z=0;
	  }
	}
     return (z);
}

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