Printing *s as triangles in Java?

后端 未结 21 1905
囚心锁ツ
囚心锁ツ 2020-11-30 11:41

My assignment in my Java course is to make 3 triangles. One left aligned, one right aligned, and one centered. I have to make a menu for what type of triangle and then input

21条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-30 12:39

    Find the following , it will help you to print the complete triangle.

    package com.raju.arrays;
    

    public class CompleteTriange {

    public static void main(String[] args) {
        int nuberOfRows = 10;
          for(int row = 0; row

    }

              *          
         ***         
        *****        
       *******       
      *********      
     ***********     
    *************    
    



提交回复
热议问题