StairCase Solution

This topic contains 0 replies, has 1 voice, and was last updated by  Nav Singh 1 year, 4 months ago.

  • Author
    Posts
  • #4455 Reply

    Nav Singh
    Keymaster
    import java.io.*;
    import java.util.*;
    
    public class Solution {
    
        public static void main(String[] args) {
            /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */
            Scanner in = new Scanner(System.in);
            int n = in.nextInt();
            for(int i=1;i<=n;i++){
                for(int j=1;j<=n;j++){
            if(i+j>n){System.out.print("#");}
                else{System.out.print(" ");}
            
            }
              System.out.println();  
            }
        }
    }
Reply To: StairCase Solution
Your information:




Official Forum

This is the Official Forum of Navsingh a community that helps you find answers to all of your problems,they can be Java/programming,wordpress,android, android programming, seo related or technology related