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呢挺郁闷的....输出是对的啊 @JAVA

Posted by jokecode at 2010-11-26 14:42:37 on Problem 1067
import java.util.*;
import java.io.*;
import java.lang.Math.*;

class Main{

public static void main(String args[]){

Scanner cateye = new Scanner(System.in);
int a,b;
while(cateye.hasNext()){
a = cateye.nextInt();
b = cateye.nextInt();
if (a == b){
System.out.println("1");
continue;}
int c,d;
c = Math.max(a,b);
d = Math.min(a,b);
if (d == 1 && c==2)
System.out.println("0"); 
if (d == 1 && c>2)
System.out.println("1");
//if (d > 1 && c==(d+1))
//System.out.println("0");
if (d>1 && (c-d)%2 == 0)
System.out.println("1");
if (d>1 && (c-d)%2 == 1)
System.out.println("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