import java.util.Scanner;
import java.io.FileInputStream;
class Solution
{
public static void main(String args[]) throws Exception
{
Scanner sc = new Scanner(System.in);
int T;
T=sc.nextInt();
int answer = 0;
while( T > 0){
answer += T%10;
T/=10;
}
System.out.println(answer);
T=0;
}
}
'SWEA' 카테고리의 다른 글
[SWEA] 알파벳을 숫자로 변환 (0) | 2024.09.13 |
---|---|
[SWEA] 연월일 달력 (0) | 2024.09.13 |
[SWEA] 중간 값 구하기 (0) | 2024.09.12 |
[SWEA] 최대수 구하기 (0) | 2024.09.12 |
[SWEA] 큰 놈, 작은 놈, 같은 놈 (0) | 2024.09.12 |