Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <windows.h>
- #include <time.h>
- int main (void)
- {
- int m = 0, s = 0, pause = 0;
- while (!GetAsyncKeyState(VK_ESCAPE))
- {
- printf("escape - quit / left/right cursor key - reset/stop\n", m, s);
- printf("%2d:%2d", m, s);
- Sleep(1000);
- system("cls");
- if (GetAsyncKeyState(VK_LEFT)) {m = 0; s = 0;}
- if (GetAsyncKeyState(VK_RIGHT)) pause = ~pause;
- if (!pause)
- {
- s++;
- if (s == 60) {s = 0; m++;}
- if (m == 60) m = 0;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment