Advertisement
gallopelado

Ejercicio del reloj

Oct 25th, 2013
368
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.55 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <time.h>
  3. #include <iostream>
  4. #include <cstdlib>
  5.  
  6. using namespace std;
  7.  
  8. void delay(unsigned int mseconds)
  9. {
  10. clock_t goal = mseconds + clock();
  11. while (goal > clock());
  12. }
  13. int main()
  14. {
  15.     int h,m,s;
  16.         for(h=0; h<24; h++)
  17.         {
  18.             for(m=0; m<60; m++)
  19.             {
  20.                 for(s=0; s<60; s++)
  21.                 {
  22.                     delay(  1000000  );
  23.                     system("clear");
  24.                     cout<<h<<" : "<< m<<" : "<<s<<endl;
  25.                 }
  26.             }
  27.         }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement