#91Easy
Sign function
Time: 1 s · Memory: 256 MB
- Functions
Statement
Write a function sign(x) that returns the sign of an integer : if , if , if . Using it, find the sign of each of the given numbers.
Input format
The first line contains (). The second line contains integers ().
Output format
A single line with numbers: , or .
Examples
Input
5 -3 0 7 -1 2
Output
-1 0 1 -1 1
Input
1 0
Output
0
Note
A function is a named piece of code: it takes an input value (a parameter) and returns a result (return). Instead of writing the same computation several times, you write it once as a function and call it where needed.
