标题:请帮忙注释一段代码,谢谢啦!
只看楼主
晴雨135
Rank: 1
等 级:新手上路
帖 子:13
专家分:0
注 册:2014-3-19
结帖率:0
 问题点数:0 回复次数:1 
请帮忙注释一段代码,谢谢啦!
void wenhou()
{
    char why[5][28] = {"晚上好!","下午好!","中午好!","早上好!","夜晚好,注意休息!"};
    char g_wenhou[30];
    int j = 0;
    int id = 0;
    time_t cur;
    time(&cur);
    struct tm *ti = localtime(&cur);
    int ft = 1, pleft,ptop,pright,pbottom;

    window_getviewport(&pleft, &ptop, &pright, &pbottom);
    if(ti->tm_hour >= 19)
        id = 0;
    else if(ti->tm_hour >= 14)
        id = 1;
    else if(ti->tm_hour >= 12 )
        id = 2;
    else if(ti->tm_hour >= 6)
        id = 3;
    else if(ti->tm_hour >= 0)
        id = 4;
    strcpy(g_wenhou,why[id]);
    setbkmode(TRANSPARENT);
    for(; j < 2; j ++)
    {
        for(int i = 0,c = 0; i < 500; i++)
        {
            if(kbmsg())
            {
                getkey();
                j = 2;
                i = 500;
            }
            if(i < 255)
            {
                c++;
                delay_fps(150);
            }
            else if(i > 255)
            {
                c--;
                delay_fps(200);
            }
            else
                delay_ms(500);
            setcolor(LIGHTBLUE);
            setbkcolor(LIGHTGREEN);
            setfont(40, 25, "幼圆");
            xyprintf( (pright - strlen(g_wenhou) * 30 )/2, (float)pbottom/2.3, "%s" ,g_wenhou);
            setfont(26,16,"楷体");
            xyprintf(pright/2-80,pbottom-100,"任意键跳过");
        }
        cleardevice();
        strcpy(g_wenhou , "我好饿,快开饭吧!");
    }
搜索更多相关主题的帖子: 晚上好 
2014-08-21 11:29
T_MACC
Rank: 4
等 级:业余侠客
威 望:8
帖 子:99
专家分:211
注 册:2015-4-14
得分:0 
虽然  好多看不懂 问下  c++ builder  是一门  怎样的语言???
2015-07-12 13:25



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




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

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