题解 | #计算单位阶跃函数#
计算单位阶跃函数
http://www.nowcoder.com/practice/0b23793ae48a4e6cb7dfff042c959a04
import java.util.Scanner; public class Main{ public static void main(String[] args) { Scanner sc = new Scanner(System.in); while(sc.hasNextInt()) { int t=sc.nextInt(); if(t>0) { System.out.println(1); } else if(t==0) { System.out.println(0.5); } else { System.out.println(0); } } } }