返回列表 發帖
  1. #include <iostream>
  2. using namespace std;
  3. int main(){

  4.     int a;
  5.     while(cin >> a){
  6.               if(a > 0){
  7.                    cout << "1" << endl;
  8.               }else if(a == 0){
  9.                     cout << "0" << endl;
  10.               }else if(a < 0){
  11.                     cout << "-1" << endl;
  12.               }
  13.     }

  14.      return 0;

  15. }
複製代碼
明輝

TOP

返回列表