All pastes #808839 Raw Edit

Untitled

public text v1 · immutable
·published 2007-12-07 23:10 UTC
rendered paste body
#include <iostream>
#include <cstdlib>
#include <time.h>
using namespace std;

void sleep(unsigned int mseconds) {
    clock_t goal = mseconds + clock();
    while (goal > clock());
}
void printnum ( int begin )
{
  cout<< begin;
  sleep(1000);
  if ( begin < 9 )         // The base case is when begin is greater than 9
  {                           //  for it will not recurse after the if-statement
      printnum ( begin + 1 ); 
  }
  cout<< begin;         // Outputs the second begin, after the program has
                              //  gone through and output
  sleep(1000);
}

int main(){
    printnum(1);
}