cswork / OA打开练习工作台

UpstartOA #4

Find the Wrong Digit Index in a Sum

估计简单可在线判题

考点(AI 标注)位运算

Compare the decimal digits of num1+num2 and givenSum, numbering positions from 0 starting at the ones digit; missing higher digits are treated as 0. Return the index of the first differing digit, or −1 if they are identical.

The standard input/output format and any supplementary ranges on this site are as stated in this problem.

输入格式

One line with three non-negative integers num1 num2 givenSum, each ≤10^18.

输出格式

Output the index of the first mismatched digit, or -1.

样例 1

输入:

13 7 19

输出:

0

样例 2

输入:

95 5 100

输出:

-1

样例 3

输入:

0 0 0

输出:

-1