AtCoder Beginner Contest 187
A
Large Digits
AtCoder
⌀ 0
原题
←B →
翻译中…

Problem Statement

翻译中…

For an integer $n$, let $S(n)$ be the sum of digits in the decimal notation of $n$. For example, we have $S(123) = 1 + 2 + 3 = 6$.

翻译中…

Given two $3$-digit integers $A$ and $B$, find the greater of $S(A)$ and $S(B)$.

翻译中…

Constraints

翻译中…
  • All values in input are integers.
  • $100 \le A, B \le 999$
翻译中…

Input

翻译中…

Input is given from Standard Input in the following format:

翻译中…

A B

翻译中…

Output

翻译中…

Print the value of the greater of $S(A)$ and $S(B)$. If these are equal, print $S(A)$.

翻译中…

样例

Input #1
123 234
Output #1
9
We have $S(123) = 1 + 2 + 3 = 6$ and $S(234) = 2 + 3 + 4 = 9$, so we should print the greater of these: $9$.
Input #2
593 953
Output #2
17
Input #3
100 999
Output #3
27
题目信息
题号
abc187_a
时间限制
2 s
内存限制
1024 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。