Skip to content

Commit f0c1a04

Browse files
committed
Initial commit
1 parent be30772 commit f0c1a04

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
Print the following pattern for the given N number of rows.
3+
Pattern for N = 4
4+
4444
5+
333
6+
22
7+
1
8+
*/
9+
10+
import java.util.Scanner;
11+
12+
public class Inverted_Number_Pattern {
13+
public static void main(String[] args) {
14+
15+
/*
16+
* Your class should be named Solution.
17+
* Read input as specified in the question.
18+
* Print output as specified in the question.
19+
*/
20+
Scanner sc = new Scanner(System.in);
21+
int n = sc.nextInt();
22+
for (int i = n; i >= 1; i--) {
23+
for (int j = 1; j <= i; j++) {
24+
System.out.print(i);
25+
}
26+
System.out.println();
27+
}
28+
29+
}
30+
}

0 commit comments

Comments
 (0)