Guest User

Untitled

a guest
Oct 15th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. #include <time.h>
  2. #include <ctime>
  3. #include <conio.h>
  4. #include <iostream>
  5. #include <cstdlib>
  6. #include <synchapi.h>
  7. #include <string>
  8.  
  9. using namespace std;
  10.  
  11. class Stoper
  12. {
  13. public:
  14. unsigned long msek;
  15. unsigned long sek;
  16. unsigned long min;
  17. unsigned long godz;
  18. public:
  19. Stoper ()
  20. {
  21. msek = 0;
  22. sek = 0;
  23. min = 0;
  24. godz = 0;
  25. }
  26.  
  27. void Obliczenie1()
  28. {
  29. if (msek == 1000)
  30. {
  31. sek++;
  32. msek = 0;
  33. }
  34. if (sek >= 59)
  35. {
  36. min++;
  37. sek = 0;
  38. }
  39. if (min >= 59)
  40. {
  41. godz++;
  42. min = 0;
  43. }
  44. }
  45. void Ustawienie()
  46. {
  47. system("cls");
  48. cout << godz << " : " << min << " : " << sek " : "
  49. Sleep(1000);
  50. }
  51.  
  52.  
  53.  
  54. };
  55.  
  56. int main() {
  57.  
  58. string 1;
  59. string 2;
  60.  
  61. Stoper dzialania;
  62. for(;;) {
  63. dzialania.Ustawienie();
  64.  
  65. }
  66.  
  67.  
  68.  
  69. return 0;
  70. }
Add Comment
Please, Sign In to add comment