public class Ex15_Continue {
	
	public static void main(String[] args) {
		// 5κ°μ μ μλ₯Ό μ
λ ₯λ°μ
		// μ
λ ₯λ°μ μ μ μ€ μμ(+)λ§ ν©κ³λ₯Ό ꡬνμ¬ μΆλ ₯νμμ€.
		Scanner sc = new Scanner(System.in);
		int sum = 0;
		
		// -3 -1  1  3  5
		// 5λ² λ°λ³΅ 
		// λ°λ³΅λ³μ i : 0 ~ 4
		for (int i = 0; i < 5; i++) {
			int n = sc.nextInt();
			// μμμΈ κ²½μ° μ μΈ
			if( n < 0 )
				continue;
			// continue
			// : λ¨μ μ€νλ¬Έμ 무μνκ³ , λ€μ λ°λ³΅μΌλ‘ μ ν
			// - while : 쑰건μμΌλ‘ λμκ°λ€
			// - for   : μ¦κ°μμΌλ‘ λμκ°λ€ 
			sum += n;
		}
		System.out.println("μμμ ν© : " + sum);
		sc.close();
	}
}
Java
볡μ¬



