| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
为什么说我WA呢挺郁闷的....输出是对的啊 @JAVA
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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator