可以不用if
#include <iostream>using namespace std;int main(){int a;//宣告cin>>a;//輸入cout << (a>0) - (a<0);//用布林值(t或f)}