fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. // Input
  6. int n; cin >> n;
  7.  
  8. // Process -> Output
  9. for (int i = n; i >= -5; --i)
  10. cout << i << ' ';
  11.  
  12. return 0;
  13. }
  14.  
Success #stdin #stdout 0.01s 5272KB
stdin
5
stdout
5 4 3 2 1 0 -1 -2 -3 -4 -5