Add time support in System.
This commit is contained in:
parent
48056daea9
commit
49ef7423a6
10
main.cpp
10
main.cpp
@ -10,13 +10,11 @@
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include <ctime>
|
||||
|
||||
#include <cpplib/cpplib#time>
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
||||
|
||||
double parseValue(string Filename)
|
||||
{
|
||||
printf("Filename : %s\n",Filename.c_str());
|
||||
@ -169,8 +167,12 @@ int main()
|
||||
printf("解析完成.\n");
|
||||
|
||||
string fname;
|
||||
printf("请输入保存文件名称...\n");
|
||||
printf("请输入保存文件名称,时间将会自动追加到结尾,后缀名为txt\n");
|
||||
getline(cin,fname);
|
||||
s_time now=whattime();
|
||||
char gpbuff[1024];
|
||||
sprintf(gpbuff,"%04d%02d%02d%02d%02d%02d",now.year,now.mon,now.day,now.hour,now.min,now.sec);
|
||||
fname+=".txt";
|
||||
printf("正在保存到 %s\n",fname.c_str());
|
||||
|
||||
ofstream ofs(fname);
|
||||
|
Reference in New Issue
Block a user