PlaidOA #1
Alternating Sum of Digits
估计简单评测数据准备中,可先阅读题面
Given an integer n, your task is to calculate the alternating sum of its digits. In other words, add up all the digits, taking the first digit with a positive sign, the second digit with a negative sign, the third digit with a positive sign, etc.
n = 521314→5 - 2 + 1 - 3 + 1 - 4 = -2n = 12134→1n = 104956→-5