n 입력받아서 별찍기
1)
*
**
***
****
*****
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
for(int i=0; i<a ; i++)
{
for(int j=0; j<=i ;j++ )
{
System.out.print("*");
}
System.out.println();
}
2번
2)
*****
****
***
**
*
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
for(int i=0; i<a ; i++)
{
for(int j=0; j<a ;j++ )
{
if(i>j) System.out.print(" ");
else System.out.print("*");
}
System.out.println();
}
3번
*
**
***
****
*****
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
for(int i=0; i<a ; i++)
{
for(int j=0; j<a ;j++ )
{
if(i+j>=a-1) System.out.print("*");
else System.out.print(" ");
}
System.out.println();
}