标题:计时小程序遇到问题,请教!!!!谢谢
取消只看楼主
haovv
Rank: 1
等 级:新手上路
帖 子:29
专家分:0
注 册:2008-9-19
结帖率:100%
 问题点数:0 回复次数:1 
计时小程序遇到问题,请教!!!!谢谢
#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 编辑 ]
搜索更多相关主题的帖子: 计时 
2010-02-03 22:12
haovv
Rank: 1
等 级:新手上路
帖 子:29
专家分:0
注 册:2008-9-19
得分:0 
屏幕上下拖拖还可以看到啊,且你输入较小的数如2 ,结果也不另人满意
2010-02-03 22:45



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-297194-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.208864 second(s), 10 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved