Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <Windows.h>
- #include <conio.h>
- using namespace std;
- //hàm lấy trạng thái phím
- inline bool IsPressed( int presskey )
- {
- return GetAsyncKeyState( presskey );//lấy trạng thái phím nhập vào
- }
- void main()
- {
- int i = 0;
- while ( !IsPressed(VK_RETURN))
- {
- Sleep(100);
- system("cls");
- cout << i++;
- if ( IsPressed(VK_RETURN))
- {
- _getch();
- }
- }
- _getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement