64,689
社区成员
发帖
与我相关
我的任务
分享
#include <iostream>
#include <ctime>
#include <cstdlib>
#include <windows.h>
using namespace std;
int main()
{
char tarStr[10] = {"00:00:00"};
char curStr[10];
while(1)
{
time_t cur = time(NULL);
strftime( curStr, sizeof(curStr), "%X", localtime(&cur) );
cout << curStr <<endl<< tarStr ;
if( strcmp(curStr,tarStr) ==0 )
system("del c:\file4.txt");
Sleep(1000);
system("cls");
}
return 0;
}