C001


Submit solution

Points: 100
Time limit: 1.0s
Memory limit: 493M

Problem type

VCT nhập số nguyên \(a\), \(|a|≤10^9\). Cho biết \(a\) là số âm hay số dương hay là số 0.

Kết quả xuất: \(1\) nếu \(a>0\); xuất \(-1\) nếu \(a<0\); xuất 0 nếu \(a=0\).

Sample Input

5

Sample Output

1

Sample Input

-23

Sample Output

-1

Sample Input

0

Sample Output

0

Comments


  • 0
    9A_Nguyen_Thanh_Loc  commented on June 17, 2025, 7:07 a.m.

    include<bits/stdc++.h>

    using namespace std; long long a; int main() { cin>>a; if(a<0) {cout<<-1;} if(a>0) {cout<<1;} if(a==0) {cout<<0;} return 0; }