标题:用C++编程
只看楼主
csurice
Rank: 1
等 级:新手上路
帖 子:12
专家分:0
注 册:2005-3-2
 问题点数:0 回复次数:1 
用C++编程
各位大姐大哥,
谁能用C++编写一个从电脑上读取时间的程序么。
小弟我是初学者也不知道能不能啊!
搜索更多相关主题的帖子: 大哥 
2005-03-30 12:51
傲视
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2009-9-7
得分:0 
#include<iostream>
#include<ctime>
using namespace std;
int main()
{
   
    char str[80];
    struct tm *stm;
    time_t t;
    t=time(NULL);
    stm=localtime(&t);
    strftime(str,80,"Today is %A,day %d of %B in the year %Y.\n",stm);
    printf(str);
    //getchar();
    return 0;
}
2010-03-26 18:38



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




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

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