我不知道问题是什么,也不知道错误消息,但我在睡眠功能上出现错误,第 41 行。我无法弄清楚。在此先感谢各位------------(我无话可说,但它不会发布更多的话)编辑——另一个错误出现在 if(GetAsyncKeyState) 行
#include <iostream>
#include <cstdlib>
using namespace std;
int main(int argc, char *argv[])
{
bool exit=false;
int hour, minute, second=0;
cout<<"Enter the hour: "<<endl;
cin>>hour;
system("cls");
cout<<"Enter the minute: "<<endl;
cin>>minute;
system("cls");
while(exit==false) {
if(minute>9 && second>9)
{
cout<<hour<<":"<<minute<<":"<<second;
}
if(minute<10 && second<10)
{
cout<<hour<<":0"<<minute<<":0"<<second;
}
if(minute<10 && second>9)
{
cout<<hour<<":0"<<minute<<":"<<second;
}
if(minute>9 && second<10)
{
cout<<hour<<":"<<minute<<":0"<<second;
}
Sleep(1000);
second++;
if(GetAsyncKeyState(VK_ESCAPE))
{
exit=true;
}
}
cout<<endl;
return EXIT_SUCCESS;
}