(Java) 숫자 입력 및 각 자릿수의 합 추출

(Java) 숫자 입력 및 각 자릿수의 합 추출 내가 만든 코드 package com.green.java.ch04; import java.util.Scanner; public class WhileStudy01 { public static void main(String() args) { int num = 0, sum = 0; Scanner scan = new Scanner(System.in); System.out.print(“숫자를 입력하세요. (예:12345) > “); String temp = scan.nextLine(); System.out.println(temp); for (int i = 0; i < temp.length(); … Read more