Skip to content

Instantly share code, notes, and snippets.

@biskandar
Created April 11, 2018 21:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save biskandar/512890445ce9052c4a97a7ec5c250141 to your computer and use it in GitHub Desktop.
Save biskandar/512890445ce9052c4a97a7ec5c250141 to your computer and use it in GitHub Desktop.
Interview with Amiga
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