Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2021
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. package com.company;
  2.  
  3. import java.util.Scanner;
  4.  
  5.  
  6. public class HardTask {
  7. public static void main(String[] args) {
  8. Scanner scanner = new Scanner(System.in);
  9. int input = Integer.parseInt(scanner.nextLine());
  10. for(int i = 1;i <= input;i++){
  11. for(int j = 1;j <= i; j++){
  12. System.out.print(j + " ");
  13. }
  14. System.out.println();
  15. }
  16. for(int k = input;k >= 1;k--){
  17. for(int f = 1; f < k;f++){
  18. System.out.print(f + " ");
  19. }
  20. System.out.println();
  21. }
  22.  
  23. }
  24. }
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement