我想为我的倒计时C ++代码添加延迟

时间:2017-10-11 16:10:27

标签: c++ delay

我希望帮助在倒计时之间获得延迟,每行等于0.75秒,我尝试添加睡眠功能,并说它无法定义标识符

#include<iostream>
#include<dos.h>
using namespace std;
int main()

{

float a;
cout << "Lets do a countdown, write a number:" << endl;
cin >> (a);
while (a > 0) {

    cout << a << endl;
    a = a--;
}
cout << "Countdown Aborted" << endl;
system("pause");

}

0 个答案:

没有答案