Skip to content

Instantly share code, notes, and snippets.

@kryvoboker
Created May 7, 2020 14:51
Show Gist options
  • Save kryvoboker/6865f156c406cc10bf06bf094f159429 to your computer and use it in GitHub Desktop.
Save kryvoboker/6865f156c406cc10bf06bf094f159429 to your computer and use it in GitHub Desktop.
HomeWork3
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