0
已解决
包涵宇
中级天翼
中级天翼
看时间代码:
#include <string>
#include <time.h>
#include<windows.h>
#include<bits/stdc++.h>
using namespace std;
string getTime()
{
time_t timep;
time (&timep);
char tmp[64];
strftime(tmp, sizeof(tmp), "%Y-%m-%d %H:%M:%S",localtime(&timep) );
return tmp;
}
int main(){
while(1){
system("cls");
string time = getTime();
cout<<time ;
Sleep(999);
}
return 0;
}