Skip to content

Instantly share code, notes, and snippets.

@kryvoboker
Created May 4, 2020 11:33
Show Gist options
  • Save kryvoboker/c9d2f41104f1b5b44732dbc329f2df3f to your computer and use it in GitHub Desktop.
Save kryvoboker/c9d2f41104f1b5b44732dbc329f2df3f to your computer and use it in GitHub Desktop.
HomeWork2
import java.util.Scanner;
/**
*
* @author kamaz
*/
public class Main {
public static void main(String [] args) {
Scanner sc = new Scanner(System.in);
int number;
System.out.println("Input number and press Enter");
number = sc.nextInt();
int a = number/10000;
int b = number%10000/1000;
int c = number%1000/100;
int d = number%100/10;
int e = number%10/1;
System.out.println("Your numbers: " +a);
System.out.println(" " +b);
System.out.println(" " +c);
System.out.println(" " +d);
System.out.println(" " +e);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment