java(476)
-
do~while문- 반복문
do~while문· while문이 [선 비교, 후 처리]라 하면 do ~ while문은 [선 처리, 후 비교]이다. · 즉, 조건식에 불만족하더라도 무조건 한번은 수행하게 되어 있습니다.· while 조건식 뒤의 ;(세미콜론) 잊지 말것 do~while 구성 및 동작
-
WhileEx03.java-while문-입력값 누적합구하기 및 0입력시 프로그램 종료하기
while문 - 입력값 누적합구하기 및 0입력시 프로그램 종료하기 소스코드 public class WhileEx03 { public static void main(String[] args) { java.util.Scanner input = new java.util.Scanner(System.in); int num = 0; int total = 0; System.out.println("0전까지 입력받은 정수로 합 구하기"); System.out.print("누적할 정수를 입력하세요 > "); while( (num=input.nextInt()) != 0 ){ total += num; System.out.println("누적합계 = " + total); System.out.print("누적할 데이터를 입력 >..
-
WhileEx02.java-1부터 100까지의 누적 합 구하기
while문 - 1부터 100까지의 누적 합 구하기 소스코드 public class WhileEx02 { public static void main(String[] args) { int sum, su; sum = su = 0; //초기식 while(su
-
WhileEx01.java-후행/선행
while문 - 후행/선행 소스코드 public class WhileEx01 { public static void main(String[] args) { int i = 10; //초기식 //후행 while( i >= 0){ //조건식 System.out.println(i--); //증감식 } System.out.println("후행 후 i : " + i); System.out.println(); //선행 int j = 10; while( j >= 0){ //조건식 System.out.println(--j); //증감식 } System.out.println("선행 후 j : " + j); System.out.println(); } } 출력결과
-
WhileEx04 - while문 형식
while문 형식 while문 구문 형식 확인 반복문을 종료하기 위한 구문 주석 처리 후 결과 재확인 소스코드 public class WhileEx04 { public static void main(String[] args) { int num=0; while(num
-
Eclipse-이클립스에서 삭제된 파일 복구하기
Eclipse 이클립스에서 삭제된 파일 복구하기 Package Exploer에서 삭제한 패키지 폴더 선택 > 마우스 우클릭 > Restore from Local History… 메뉴 클릭 복구가능한 히스토리에 파일이 존재하는 경우 해당 파일 체크 후 > Restore 클릭 복가능한 히스토리가 없는 경우 메세지