|
自己写了下,能执行。
代码有不足的希望能指正。
#include <stdio.h>
#include <stdlib.h>
#include<windows.h>
int main()
{
int a,b,c,d;
printf("请输入倒计时分钟数:");
scanf("%d",&a);
printf("按回车键继续...");
getch();
system("cls");
printf("倒计时开始\n");
printf("按回车键继续...");
getch();
system("cls");
b=00;
//printf("%d:%d",a,b);
while (a+b>0)
{
if (b==00)
{
a--;
b=59;
}
else
{
b--;
}
if (b<=9)
{
printf("%d:0%d",a,b);
}
else
{
printf("%d:%d",a,b);
}
Sleep(1000);
system("cls");
}
system("pause");
return 0;
}
|
|