// 432를 입력하면 4 + 3 + 2 + 432 = 441이 나오게끔
import java.util.*;
class Solution {
public int number_create(int n) {
int solution = 0;
int lastAdd = n;
while (n != 0) {
solution += n % 10;
n /= 10;
}
solution += lastAdd;
return solution;
}
public static void main(String[] args) {
Solution sol = new Solution();
int num1 = 432;
int solution = sol.number_create(num1);
System.out.println(solution);
}
}
후... 박제중이다.....
자바...음... - dc Cpp
후... 로직은 같은거다... 아직 시 플러스 플러스 를 못배웠다...
스캐너 클래스를 이용하여 숫자를 입력받아서 처리할 수 있도록 해주세요 - dc Cpp
귀찮다... 후.....
그런걸로 벌써 귀찮으시면 - dc Cpp
후...