ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1877. Bicycle Codes

Why this code on java does'n work/Почему код на java не работает(не проходит проверку)
Posted by Big_Brother 1 Aug 2013 02:53
import java.util.Scanner;

public class BicycleCode{
    public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int firstCode = sc.nextInt();
    int secondeCode = sc.nextInt();

    if(firstCode%2==0 && secondeCode%2!=0){
    System.out.println("yes");
    }else if(firstCode%2!=0 && secondeCode%2==0){
    System.out.println("no");
    }
    }
}
Re: Why this code on java does'n work/Почему код на java не работает(не проходит проверку)
Posted by Big_Brother 1 Aug 2013 03:16
the correct code:
import java.util.Scanner;

public class BicycleCode{
    public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int firstCode = sc.nextInt();
    int secondeCode = sc.nextInt();

    if(firstCode%2==0 || secondeCode%2!=0){
    System.out.println("yes");
    }else if(firstCode%2!=0 || secondeCode%2==0){
    System.out.println("no");
    }
    }
Re: Why this code on java does'n work/Почему код на java не работает(не проходит проверку)
Posted by a8 14 Mar 2014 13:33
1

Edited by author 14.03.2014 13:34