zoukankan      html  css  js  c++  java
  • 时间显示的小程序

    /*
    注意,这里面的sleep()函数,如果在windows环境下,就是Sleep(),如果是linux是sleep(),主要在于是使用gcc,还是vs的编译器。
    */ #include <stdio.h> #include <stdlib.h> #include <Windows.h> #include <time.h> void put_date(void) { time_t current; struct tm *local;char wday_name[][7] = {"星期日""星期一""星期二""星期三""星期四""星期五""星期六"}; printf("%4d 年 %02d 月 %2d 日(%s)",local->tm_year+1990 ,local->tm_mon+1,local->tm_mday ,wday_name[local->tm_wday]); printf("%2d:%02d:%02d",local->tm_hour,local->tm_min,local->tm_sec); } int main(void) { int a=1000; while(true){ system("cls"); put_date(); Sleep(a); } return 0; }
    花間酒氣;竹裹棋聲。 山奔海立;沙起雷行。 風雲論道;筆墨通天。
  • 相关阅读:
    yii中通过HTTP post接收
    网络编程
    python 异常处理
    面向对象(2)
    面向对象
    什么是模块精讲
    常用模块二
    各种推导式详解
    匿名函数
    迭代器生成器
  • 原文地址:https://www.cnblogs.com/banshiliuli1990/p/3795498.html
Copyright © 2011-2022 走看看