В вашем нынешнем коде вы просто печатаете пространство.Теперь нужно сделать еще один шаг и напечатать числа вместе с новой строкой.
Вы можете сделать это следующим образом. Посмотрите, как это работает здесь :
public class PattrenClass
{
public static void main(String[] args)
{
//Connecting Keyboard to Scanner with `try-with-resources`
try(Scanner sc = new Scanner(System.in);)
{
System.out.println("How many rows you want in this pattern?");
int rows = sc.nextInt(); //Taking rows value from the user
System.out.println("Here is your pattern....!!!");
for (int i = rows; i > 0; i--)
{
for (int j = 1; j < i; j++)
{
System.out.print(" ");
}
for (int j = rows; j >= i; j--)
{
System.out.print(j);
}
System.out.println();
}
}
}
}
ВЫХОД :
How many rows you want in this pattern?
5
Here is your pattern....!!!
5
54
543
5432
54321