Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,26 +37,16 @@ Integer N (Total no. of rows)

import java.util.*;

public class InvertedTriangleNum {
public class Solution {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int N=scan.nextInt();
for (int i=0;i<N;i++)
{
int val=1;
for (int j=0;j<(N-i-1);j++)
{
System.out.print(" ");
for(int i=N; i>0; i--){
for(int j=0; j<i; j++){
System.out.print(i);
}

for (int j=0;j<=i;j++)
{
System.out.print(val);
val++;
}
System.out.println(" ");
System.out.println();
}
scan.close();

}

Expand Down