- #include <stdio.h>
- #include <stdlib.h>
- #include <windows.h>
- int main()
- {
- int a=0,b=0,c=0;
- system("color 0a");
- printf("%02d:%02d:%02d",c,b,a);
- Sleep(1000);
- while(a<=60&&b<=60&&c<=24)
- {
- system("cls");
- if(b>=60)
- {
- c+=1;
- b=0;
- }
- if(a>=60)
- {
- b+=1;
- a=0;
- }
- if(c==24)
- break;
- a+=1;
- printf("%02d:%02d:%02d",c,b,a);
- Sleep(1000);
- }
- system("pause");
- return 1;
- }
复制代码 |