Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Triangle {
- public static void main(String[] args) {
- int n = 10;
- StringBuilder sb = new StringBuilder();
- for (int i = n; i > 0; i--) {
- for (int j = 0; j < n - i; j++)
- sb.append(" ");
- for (int j = 0; j < i; j++)
- sb.append("○");
- sb.append("\n");
- }
- System.out.print(sb.toString());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement