• + 15 comments

    In Java I did this:

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        char [] arreglo = new char [n];
        Arrays.fill(arreglo, ' ');
        int i = 0;
        for (i = 1; i <= n; i++){
            arreglo[n-i] = '#';
            System.out.println(arreglo);
        }
    
    }
    

    I hope it wasn't that bad XD but I wanted to post it cos I didn't find it that simple after all for Java. Made me think a lot. :)