Skip to content

Instantly share code, notes, and snippets.

@CSaratakij
Created March 21, 2016 03:23
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 CSaratakij/e1df7293365b85de76e6 to your computer and use it in GitHub Desktop.
Save CSaratakij/e1df7293365b85de76e6 to your computer and use it in GitHub Desktop.
package exnumloopflagver2;
public class ExNumLoopFlagVer2 {
public static void main(String[] args) {
int maxNum = 6;
int dragNum = 1;
for (int i = maxNum; i > 0; i--) {
for (int n = 1; n < i; n++) {
System.out.print(" ");
}
for (int g = dragNum ; g > 0; g--) {
System.out.print(g);
}
dragNum += 1;
System.out.println();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment