你值得拥有:
看代码:(1)
![](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.gif)
1 #include <ctime> 2 #include <iostream> 3 int main() 4 { 5 std::time_t result = std::time(NULL); 6 std::cout << std::ctime(&result); 7 }
看代码:(2)
![](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.gif)
1 #include <ctime> 2 #include <iostream> 3 4 int main() 5 { 6 std::time_t result = std::time(NULL); 7 std::cout << std::asctime(std::localtime(&result)); 8 }