fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int n;
  6. cin >> n;
  7. if(n > -5){
  8. for(int i = n;i >= -5;i--){
  9. cout << i << " ";
  10. }
  11. }
  12. else if(n < -5){
  13. for(int i = n;i <= -5;i++){
  14. cout << i << " ";
  15. }
  16. }
  17. else cout << "-5";
  18. return 0;
  19. }
Success #stdin #stdout 0.01s 5296KB
stdin
-10
stdout
-10 -9 -8 -7 -6 -5