fork download
  1. #include <iostream>
  2. #include <iomanip>
  3. using namespace std;
  4. int main(){
  5. //input
  6. int n;
  7. cin>>n;
  8. //process
  9. bool check=false;
  10. bool test=false;
  11. if(n==0){
  12. check=true;
  13. }
  14. else{
  15. if(n>0){
  16. test=true;
  17. }
  18. }
  19. //output
  20. if(check) cout<<"n is equal to zero";
  21. else{ if(test){
  22. cout<<"n is postiive number";
  23. }
  24. else cout<<"n is negative number";
  25. }
  26. return 0;
  27. }
  28.  
Success #stdin #stdout 0.01s 5292KB
stdin
Standard input is empty
stdout
n is postiive number