Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package test;
- import java.util.Scanner;
- public class Test2 {
- public static void main(String[] args) {
- Scanner keyboard = new Scanner(System.in);
- System.out.println("input : ");
- int n = keyboard.nextInt();
- for (int j = 1; j <= n; j++) {
- int v = 0;
- for (int i = n; i > 0; i--) {
- if (j == i) {
- v = i;
- }
- if (i != n) {
- System.out.print(",");
- }
- System.out.print(v);
- if (v > 0) {
- v = v - 1;
- }
- }
- System.out.println();
- }
- }
- }
Add Comment
Please, Sign In to add comment