标签:cout oat ios nbsp 编写 mes iostream done starting
目的是延时显示
示例:
long wait = 0;
while(wait<10000)
wait++;
程序示例————来源于《c++ primer plus》ps149,程序清单5.14
#include <iostream>
#include <Ctime>
using namespace std;
int main()
{
cout<<"Enter the delay time,in seconds: ";
float secs;
cin>>secs;
clock_t delay = secs * CLOCKS_PER_SEC;
cout<<"starting\a"<<endl;
clock_t start = clock();
while (clock()-start<delay)
;
cout<<"done \a"<<endl;
return 0;
}
标签:cout oat ios nbsp 编写 mes iostream done starting
原文地址:https://www.cnblogs.com/whtmomo/p/9463948.html