0
点赞
收藏
分享

微信扫一扫

C++_格式化输出时分秒

刘员外__ 2022-01-09 阅读 65
c++
#include<time.h>
#include   <fstream> 
#include   <string> 
#include <iostream>
using namespace std;//cout

time_t now = time(0);
tm ltm;

now = time(0);
localtime_s(&ltm, &now);

printf("%d:%d:%d#收到触发信号\n", ltm.tm_hour, ltm.tm_min, ltm.tm_sec);
举报

相关推荐

0 条评论