반복

While로 sum구하기 실습 1-4 public class SumWhile { public static void main(String[] args) { Scanner stdIn = new Scanner(System.in); System.out.println("1부터 n까지의 합을 구합니다"); System.out.print("n의 값 : "); int n = stdIn.nextInt(); int sum = 0; int i = 1; while (i while문이 종료될 때 == 조건이 성립하지 않을 때 == i > n 일 때 i값 출력 For로 sum구하기 실습 1-5 public class SumFor { public static void main(String[] args) { Scanner stdIn..
dev_rosieposie
'반복' 태그의 글 목록