All pastes #390088 Raw Edit

Stuff

public text v1 · immutable
·published 2007-03-11 03:51 UTC
rendered paste body
#ifdef __GNUC__
#include <unistd.h>
#endif

#ifdef _WIN32
#include <cstdlib>
#endif

#include <iostream>
#include <iomanip>
using namespace std;

int main()
{
  cout << "CTRL-C to exit...\n";

  for (int count = 10; count > 0; count--) {
    cout << count << ' ';
    cout.flush();

    #ifdef __GNUC__
    sleep(1);
    #endif

    #ifdef _WIN32
    _sleep(1000);
    #endif
    count << '\r';
  }
  return 0;
}