Guest User

Untitled

a guest
Apr 19th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. package test;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Test2 {
  6.  
  7. public static void main(String[] args) {
  8.  
  9. Scanner keyboard = new Scanner(System.in);
  10.  
  11. System.out.println("input : ");
  12.  
  13. int n = keyboard.nextInt();
  14.  
  15. for (int j = 1; j <= n; j++) {
  16. int v = 0;
  17. for (int i = n; i > 0; i--) {
  18. if (j == i) {
  19. v = i;
  20. }
  21. if (i != n) {
  22. System.out.print(",");
  23. }
  24. System.out.print(v);
  25. if (v > 0) {
  26. v = v - 1;
  27. }
  28. }
  29. System.out.println();
  30. }
  31.  
  32. }
  33.  
  34. }
Add Comment
Please, Sign In to add comment