import java.util.Scanner;


public class StarDot_While {


public static void main(String[] args) {

// TODO Auto-generated method stub


int b = 0, c = 0;

Scanner firstInNum = new Scanner(System.in);

int a = firstInNum.nextInt(); // a = 입력받을 수


if(a>0) {

while(b<a) {

c=0; //while문 초기화 ㅡㅡ

while(c<=b) {

System.out.print("*");

c++;

}

System.out.println();

b++;

}//end while

}//end if

else {

System.out.println("잘못입력하신 것 같습니다. 양의 정수를 입력해주세요.");

}

}


}



블로그 이미지

irostub

iro의 잡화상점

,