#include <stdio.h>
#include <windows.h>
main()
{
int m=0,s=0;
printf("输入分秒,以空格间隔\n");
scanf("%d %d",&m,&s);
if (s>=60)
{
m+=s/60;
s-=m*60;
}
printf("Press any key to continue\n");
getch();
while (m>=0)
{
while (s>=0)
{
system("cls");
printf("剩余%02d分%02d秒\n",m,s);
Sleep(1000);
s--;
}
m--;
s=59;
}
system("cls");
}
每秒清一次屏,另外还加了个"Press any key to continue"来坑人……