题解 | #计算单位阶跃函数#
计算单位阶跃函数
https://www.nowcoder.com/practice/0b23793ae48a4e6cb7dfff042c959a04
public class Program{ public static void Main() { string line; while((line=System.Console.ReadLine())!=null) { int num = int.Parse(line); if(num>0) System.Console.WriteLine(1); else if(num==0) System.Console.WriteLine(0.5); else if(num<0) System.Console.WriteLine(0); } } }