Created
April 11, 2018 21:49
-
-
Save biskandar/512890445ce9052c4a97a7ec5c250141 to your computer and use it in GitHub Desktop.
Interview with Amiga
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment