Created
March 16, 2020 11:16
-
-
Save dalcon10028/5f7d91c152189ca1913d93f995a3a9b2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.*; | |
| public class Main { | |
| public static void main(String[] args) { | |
| Scanner sc = new Scanner(System.in); | |
| int n = sc.nextInt(); | |
| for (int i=1; i<=2*n-1; i++){ | |
| if (i<=n){ | |
| for(int j=0; j<i; j++) | |
| System.out.print("*"); | |
| System.out.println(); | |
| }else{ | |
| for(int j=0; j<2*n-i; j++) | |
| System.out.print("*"); | |
| System.out.println(); | |
| } | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment