Competitive Programming Solutions

GitHub
back to dashboard

P. Shape1

Codeforces - Sheet #2 (Loops) · limit: 1s · memory: 256MB · view on codeforces

input

4

output

****
***
**
*
Main.java
static void solve() {

        // Write your solution here
        int n = in.nextInt();
        while (n > 0) {
            int j = 1;
            while (j++ <= n)
                out.print("*");
            out.println();
            n--;
        }

    }