1797: 分段函数
Memory Limit:256 MB
Time Limit:1.000 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
编写程序,计算下列分段函数y=f(x)的值。y=-x+2.5;( 0≤x<5)y=2-1.5(x-3)(x-3); (5≤x<10)y=x/2-1.5; (10≤x< 20)
Input
一个浮点数N,0 ≤ N < 20。
Output
输出N对应的分段函数值:f(N)。结果保留到小数点后三位。
Sample Input Copy
1.0
Sample Output Copy
1.500