1934 加减数字


Submit solution

Points: 100
Time limit: 1.0s
Memory limit: 32M

Problem types
Allowed languages
C, C++, Java, Python

Description

贝贝从小就喜欢数字,喜欢对一些数字进行莫名其妙的计算。这几天,他又开始折腾一些整数了。当他拿到一个整数时,就将首位数减第二位数再加第三位数再减第四位……,就这样把这个数弄到末位。例如,他看到一个整数123456,他就进行计算:1-2+3-4+5-6=-3。贝贝做这个事是不是太累哦,你来编程帮他一下吧,让贝贝见识一下编程的魅力,而对编程产生出兴趣来。

Input

一些正整数n(0<n<2^31)。

Output

每个加减数字结果用一行输出。

Sample

Input

0  2  34  23  23456  123456

Output

0
2
-1
-1
4
-3

Source: qn


Comments

There are no comments at the moment.