如果只是要输出,用system(“time”);就行了。
而获取日期则用system(“date”);。
例子(输出当前时间及日期):
#include<bits/stdc++.h>
using namespace std;
int main()
{
system("time");
system("date");
return 0;
}
如果只是要输出,用system(“time”);就行了。
而获取日期则用system(“date”);。
例子(输出当前时间及日期):
#include<bits/stdc++.h>
using namespace std;
int main()
{
system("time");
system("date");
return 0;
}