Skip to content

Instantly share code, notes, and snippets.

@mariiaKolokolova
Created April 26, 2020 16:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mariiaKolokolova/2abd869b7b0bacf3e48e2ff1750b5e70 to your computer and use it in GitHub Desktop.
Save mariiaKolokolova/2abd869b7b0bacf3e48e2ff1750b5e70 to your computer and use it in GitHub Desktop.
Lesson1_get_list
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