Problem1951--符号函数

1951: 符号函数

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 0  Solved: 0
[Submit] [Status] [Web Board] [Creator:]

Description

本题要求实现符号函数sign(x)。 函数接口定义: int sign( int x ); 其中x是用户传入的整型参数。符号函数的定义为:若x大于0,sign(x) = 1;若x等于0,sign(x) = 0;否则,sign(x) = −1。 裁判测试程序样例: #include int sign( int x ); int main() { int x; scanf(

Input

其中x是用户传入的整型参数

Output

符号函数的定义为:若x大于0,sign(x) = 1;若x等于0,sign(x) = 0;否则,sign(x) = −1

Sample Input Copy

10

Sample Output Copy

sign(10) = 1

Source/Category

200