|
#include<bits/stdc++.h>
#include <windows.h>
using namespace std;
void gotoxy(HANDLE hout, int x, int y);
void gotoxy(HANDLE hout, int x, int y){
COORD pos;
pos.X = x;
pos.Y = y;
SetConsoleCursorPosition(hout, pos);
};
int main(){
HANDLE hout = GetStdHandle(STD_OUTPUT_HANDLE);
int h,m,s;
h=18;
m=24;
s=30;
while(1){
if(s==60){
s=0;
m+=1;
}
if(m==60){
m=0;
h+=1;
}
cout<<setw(2)<<h<<":"<<setw(2)<<m<<":"<<setw(2)<<s<<endl;
Sleep(1000);
s+=1;
gotoxy(hout,0,0);
}
return 0;
}
|
|