- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
Latest commit
21 lines (19 loc) · 466 Bytes
/
Copy pathMain.java
File metadata and controls
21 lines (19 loc) · 466 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
importjava.io.*;
importjava.util.*;
publicclassMain {
publicstaticvoidmain(String[] args) {
Scannersc = newScanner(System.in);
intn = sc.nextInt();
intk = 0;
for (inti = 0; i < n; i++) {
for (intj = 0; j < n; j++) {
if ((j == 0 && (i % 2) == 1) || (j == n && (i % 2) == 0)) {
System.out.print("S ");
} else {
System.out.print(" ");
}
}
System.out.println();
}
}
}