搜索
楼主: rosynirvana
打印 上一主题 下一主题

【第四章第5节】动手试一试 题解

[复制链接]
16#
发表于 2014-6-18 12:08:32 | 只看该作者
为什么要分四段呢?
17#
发表于 2014-7-3 15:40:35 | 只看该作者
支持楼主!!
18#
发表于 2014-7-26 22:21:26 | 只看该作者
Good!这是最简单的:01.#include <stdio.h>

02.#include <stdlib.h>

03.#include <windows.h>

04.int main()

05.{

06.  int sec;

07.  for(sec = 120; sec >= 0; --sec){

08.    printf("%d:%02d", sec / 60, sec % 60);

09.    Sleep(1000);

10.    system("cls");

11.  }

12.  system("pause");

13.  return 0;

14.}
(运用楼主的)
19#
发表于 2014-8-6 11:10:36 | 只看该作者
楼主好牛啊!!!
20#
发表于 2015-7-31 11:02:42 | 只看该作者
好厉害,膜拜大神{:soso_e179:}
21#
发表于 2015-8-31 02:03:52 | 只看该作者
本帖最后由 sujx 于 2015-8-31 02:07 编辑

[mw_shl_code=c,true]
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
int main()
{        
        int t,m,s;
    t=120;            
    while(t>=0)
    {
                m=t/60;
                s=t%60;
                printf("%d:%02d",m,s);
        t--;
        Sleep(1000);
        system("cls");        
    }
    printf("Time is over!\n");
    system("pause");
    return 0;
}[/mw_shl_code]

22#
发表于 2015-9-18 13:45:51 | 只看该作者
我的思路;
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
int main()
{
        int a=2,b=0;
    while (b>=0)
    {       
        if (10>b)
                printf("%d:0%d",a,b);
        else
        printf("%d:%d",a,b);
        b--;
        if (b<0)
                        {
                                if(a!=0)
                                a--;
                                b=59;
            }
        Sleep(1000);
        system("cls");
    }
        system("pause");
        return 0;
}
23#
发表于 2018-10-24 16:51:44 | 只看该作者
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
int main()
{
       
    int a;       
    printf("2:00");
    Sleep(1000);
   
     
     a=59;
     while (a>=10)
     {system("cls");
     printf("1:%d",a);
     Sleep(1000);
     a=a-1;}
     
     a=9;     
     while(a>=0)
     {system("cls");
     printf("1:0%d",a);
     Sleep(1000);
     a=a-1;}
      
      a=59;
      while (a>=10)
     {system("cls");
     printf("0:%d",a);
     Sleep(1000);
     a=a-1;}
     
      a=9;     
     while(a>=0)
     {system("cls");
     printf("0:0%d",a);
     Sleep(1000);
     a=a-1;}
   
   
   
   
        system("pause");
        return 0;
}
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

广播台
特别关注
快速回复 返回顶部 返回列表