Skip to content

Instantly share code, notes, and snippets.

@hyperion0201
Created September 5, 2017 07:05
Show Gist options
  • Save hyperion0201/58ec4d5ea560b289691ae991f47ba526 to your computer and use it in GitHub Desktop.
Save hyperion0201/58ec4d5ea560b289691ae991f47ba526 to your computer and use it in GitHub Desktop.
Right-Angled Triangle create by a num.
import java.util.*;
//import javax.swing.*;
class Square{
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.println("Nhap vao so n : ");
int n = scan.nextInt();
for (int i = 0; i <= n; i++) {
for (int j = i; j<=(n-1); j++ ) {
System.out.print("*");
}
System.out.print("\n");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment