Created
April 26, 2020 16:13
-
-
Save mariiaKolokolova/2abd869b7b0bacf3e48e2ff1750b5e70 to your computer and use it in GitHub Desktop.
Lesson1_get_list
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
package maricka.kolokolova; | |
import java.util.Scanner; | |
public class Main { | |
public static void main(String[] args) { | |
// TODO Auto-generated method stub | |
Scanner sc = new Scanner(System.in); | |
int a; | |
int x1; | |
int x2; | |
int x3; | |
int x4; | |
int x5; | |
System.out.println("Input five-digit number:"); | |
a = sc.nextInt(); | |
x1 = a / 10000; | |
x2 = a % 10000 / 1000; | |
x3 = a % 1000 / 100; | |
x4 = a % 100 / 10; | |
x5 = a % 10; | |
System.out.println("Your number is:"); | |
System.out.println(x1); | |
System.out.println(x2); | |
System.out.println(x3); | |
System.out.println(x4); | |
System.out.println(x5); | |
sc.close(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment