Created
May 7, 2020 14:51
-
-
Save kryvoboker/6865f156c406cc10bf06bf094f159429 to your computer and use it in GitHub Desktop.
HomeWork3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
/** | |
* | |
* @author kamaz | |
*/ | |
public class Main { | |
public static void main(String [] args) { | |
Scanner sc = new Scanner(System.in); | |
System.out.println("Input a"); | |
int a = sc.nextInt(); | |
int b = a/100000; | |
int c = a%100000/10000; | |
int d = a%10000/1000; | |
int e = a%1000/100; | |
int f = a%100/10; | |
int g = a%10/1; | |
if (b == g && c == f && d == e) { | |
System.out.println("Ok"); | |
} | |
else { | |
System.out.println("Bad"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment