import java.util.Scanner;
public class U1_L5_Activity_One {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.print("Please enter a two digit number: ");
int x = scan.nextInt();
System.out.println("Here are the digits:");
System.out.println(x/100);
System.out.println((x/10)%10); //Just divide the result by 10 and find the remainder
System.out.println(x%10);
}
}
//Or, you can do that way:
import java.util.Scanner;
public class U1_L5_Activity_One {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.print("Please enter a two digit number: ");
String[] x = scan.nextLine().split(""); //We need it to be a string array, to split the values after "", that is, after each symbol(number)
System.out.println("Here are the digits:");
for(int i = 0; i<x.length; i++) {
System.out.println(Integer.parseInt(x[i])); //Converting the string into int, as you want
}
}
}