关于计时器

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n,late;

int main(){
	n = time(0);
	int cnt = 0,min = 0,hour = 0;
	while(1){
		n = time(0);
		if(late != n){
			printf("这是这个程序证明 ljh ---- > sbb的第%d小时第%d分钟第%d秒\n",hour,min,cnt++);
			if(min != 59 && cnt == 60){
				cnt = 0;
				min++;
			}
			if(min == 59 && cnt == 60){
				min = 0;
				cnt = 0;
				hour++;
			}
			late = n;
		}
		continue;
	}
	return 0;
}
posted @ 2020-07-06 16:45  HISKrrr  阅读(150)  评论(3编辑  收藏  举报