# while 문 #### CODE <a class='btn btn-default' href='/codes/29378'>Link</a> ``` public class WhileStatement { public static void main(String[] args) { System.out.println("카운트 다운을 시작합니다.."); int num = 5; while (num <= 0) { System.out.printf("%d..\n", num); num--; System.out.println("발사!!"); } } ``` #### INPUT ``` ``` #### OUPUT ``` /root/var/tmp/2020_07_24_23_44_41_647bc81b/WhileStatement.java:11: error: reached end of file while parsing } ^ 1 error ```
## 문제의 목적이 num 이 5부터 -1씩 감소하면서 0이 되었을 때 발사 가 출력되게 하는것 입니다. int num = 5; while (num <= 0) { System.out.printf("%d..\n", num); num--; } System.out.println("발사!!"); 반복문 안에서는 num의 값을 -1씩 감소시켜야 하고 "빌사!!"를 출력하는 부분은 while문 바깥에 존재 해야 합니다.