题解 | #计算单位阶跃函数#
知识点:
分支控制:分支控制
if(){}
else if(){}
else{}
#include <iostream>
using namespace std;
int main() {
    int t = 0;
    while (cin >> t) {
        if (t > 0) {
            cout << 1 << endl;
        } else if (t == 0) {
            cout << 0.5 << endl;
        } else {
            cout << 0 << endl;
        }
    }
    return 0;
}
	

