Với code đồng hồ ở topic trước. Em muốn tạo lệnh press any key to pause /play thì làm thế nào ạ?
#include <iostream>
#include <Windows.h>
#include <iomanip>
using namespace std;
int main()
{
int h, m, s;
for (h = 0; h < 60; h++)
{
for (m = 0; m < 60; m++)
{
for (s = 0; s < 60; s++)
{
Sleep(1000);
system("CLS");
cout << setfill('0') << setw(2) << h << ":";
cout << setfill('0') << setw(2) << m << ":";
cout << setfill('0') << setw(2) << s;
}
}
}
return 0;
}
83% thành viên diễn đàn không hỏi bài tập, còn bạn thì sao?