BC70 计算单位阶跃函数
思路:
step1:输入一个数;判断输出打印;
代码如下:
while True:
try:
a = int(input())
if a > 0:
print('1')
elif a == 0:
print('0.5')
elif a < 0:
print('0')
except:
break
while True:
try:
a = int(input())
if a > 0:
print('1')
elif a == 0:
print('0.5')
elif a < 0:
print('0')
except:
break