posts - 225, comments - 62, trackbacks - 0, articles - 0
   :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理

简陋而有趣的倒计时程序

Posted on 2007-07-10 15:57 魔のkyo 阅读(277) 评论(0)  编辑 收藏 引用
#include <stdio.h>
#include 
<stdlib.h>
#include 
<conio.h>

int main()
{
    
int x,i;
    printf(
"时间设定(s):");
    scanf(
"%d",&x);
    
for(i=x;i>=0;i--){
        printf(
"\r%10d",i);
        _sleep(
1000);
    }
    printf(
"时间已到!\n");
    
while(!kbhit()){
        printf(
"\a");
        _sleep(
500);
    }
}
只有注册用户登录后才能发表评论。