计时小程序遇到问题,请教!!!!谢谢
#include <iostream.h>#include<ctime>
enum Color{BLACK,WHITE,BLUE};
int main()
{
long t1;
int set;
cin>>set;
for(int i=1;i<=set;i++)
{
t1=time(NULL);
t1++;
while(time(NULL)<t1);
cout<<"**************************"<<endl;
}
cout<<"the time is comming!";
}//这个程序的本意
#include <iostream.h>
#include<ctime>
enum Color{BLACK,WHITE,BLUE};
int main()
{
long t1;
int set;
cin>>set;
for(int i=1;i<=set;i++)
{
t1=time(NULL);
t1++;
while(time(NULL)<t1)
{cout<<"-";}
cout<<"**************************"<<endl;
}
cout<<"the time is comming!";
}//这个结果和上个结果********************的显示次数不同,为什么??
[ 本帖最后由 haovv 于 2010-2-3 23:19 编辑 ]