| 1 | import java.io.IOException; |
| 2 | import java.io.*; |
| 3 | public class Codechef3 { |
| 4 | public static void main(String[] args) throws IOException{ |
| 5 | BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); |
| 6 | int n = Integer.parseInt(br.readLine()); |
| 7 | for (int row = 0; row < n; row++) { |
| 8 | for (int spaces = n; spaces > row; spaces--) { |
| 9 | System.out.print(" "); |
| 10 | } |
| 11 | if(row%2!=0){ |
| 12 | for (int i = 0; i <= row; i++) { |
| 13 | if (i%2!=0 || i != 1) { |
| 14 | if(i == 0 || i == row){ |
| 15 | System.out.print("* "); |
| 16 | } |
| 17 | else{ |
| 18 | System.out.print(" "); |
| 19 | } |
| 20 | } |
| 21 | } |
| 22 | } |
| 23 | else{ |
| 24 | for (int i = 0; i <= row; i++) { |
| 25 | System.out.print("* "); |
| 26 | } |
| 27 | } |
| 28 | System.out.println(); |
| 29 | } |
| 30 | } |
| 31 | } |
nothing calls this directly
no outgoing calls
no test coverage detected