#include <iostream>
#include <iomanip>
using std::cout;
using std::setw;
#ifdef __GNUC__
#include <unistd.h>
#endif
#ifdef _WIN32
#include <cstdlib>
#endif
int main()
{
cout.fill('0');
for (int hr = 0; hr < 24; hr++)
{
for (int min = 0; min < 60; min++)
{
for (int sec = 0; sec < 60; sec++)
{
cout << setw(2) << hr << ':';
cout << setw(2) << min << ':';
cout << setw(2) << sec << ' ';
cout.flush();
#ifdef __GNUC__
sleep(1); // 1 секунда
#endif
#ifdef _WIN32
_sleep(1000); // 1 секунда
#endif
cout << '\r'; // CR
}
}
}
}
Комментарии
comments powered by Disqus