Skip to content

Commit d60f3ce

Browse files
committed
Initial commit
1 parent 163e178 commit d60f3ce

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
Print the following pattern for the given N number of rows.
3+
Pattern for N = 4
4+
1
5+
22
6+
333
7+
4444
8+
*/
9+
10+
import java.util.*;
11+
12+
public class Triangle_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+
23+
for (int i = 0; i <= N; i++) {
24+
for (int j = 0; j < i; j++) {
25+
System.out.print(i);
26+
}
27+
System.out.println("");
28+
}
29+
30+
}
31+
}

0 commit comments

Comments
 (0)