-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathPrintPath.java
More file actions
31 lines (28 loc) · 764 Bytes
/
PrintPath.java
File metadata and controls
31 lines (28 loc) · 764 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
public class PrintPath {
static void wrong_print(int row) {
char start = 'a';
for(int i = 0; i < row; i += 1) {
//char start = 'a';
char print = start;
for(int j = 0; j <= i; j += 1) {
System.out.print(start++);
}
System.out.println();
}
}
static void print(int row) {
// char start = 'a';
for(int i = 0; i < row; i += 1) {
char start = 'a';
char print = start;
for(int j = 0; j <= i; j += 1) {
System.out.print(start++);
}
System.out.println();
}
}
public static void main(String[] args) {
wrong_print(4);
print(4);
}
}