fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. for(int i(5); i-->0; ) {
  6. cout << i << " ";
  7. }
  8. cout << "\n";
  9.  
  10. for (int i = 5; i > 0; i--) {
  11. cout << i << " ";
  12. }
  13. cout << "\n";
  14. }
Success #stdin #stdout 0.02s 2724KB
stdin
Standard input is empty
stdout
4 3 2 1 0 
5 4 3 2 1