sign(x)
Problem
In mathematics, the function sign(x)
(sign of a number) is defined as follows:
sign(x) = 1, if x > 0,
sign(x) = -1, if x < 0,
sign(x) = 0, if x = 0.
For the given number x
print the value sign(x)
.
Input
One integer is entered.
Imprint
Output the answer to the problem.
Solve the problem using a nested conditional operator if... else if... else
(if ... elif ... else -
for Python).< /p>
Examples