|
|
back to boardWhy this code on java does'n work/Почему код на java не работает(не проходит проверку) 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 не работает(не проходит проверку) 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 |
|
|