Printing *s as triangles in Java?

后端 未结 21 1898
囚心锁ツ
囚心锁ツ 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:31

    1) Normal triangle

    package test1;
    
    
     class Test1 {
    
         public static void main(String args[])
         {
             int n=5;
         for(int i=0;i

    2) right angle triangle

    package test1;
    
    
     class Test1 {
    
         public static void main(String args[])
         {
             int n=5;
         for(int i=0;i

    3) Left angle triangle

    package test1;
    
    
     class Test1 {
    
         public static void main(String args[])
         {
             int n=5;
         for(int i=0;i

提交回复
热议问题