程序经调试,能运行!
源程序:
#include "stdio.h"
#include "conio.h"
#include "dos.h"
struct tim
{ int minute;
int second;
};
void show(struct tim t);
main()
{ struct tim t;
clrscr();
printf("\n\n\n\n\n\ please input the time of dingshi:");
scanf("%d:%d",&t.minute,&t.second);
show(t);
printf("\n\n\n\n\n %d minute %d second has come!\n",t.minute,t.second);
getch();
}
void show(struct tim t)
{ do
{ clrscr();
printf("\n\n\n\n\n %2d:%2dleft",t.minute,t.second);
delay(1000000);
if(t.second==0)
if(t.minute>0)
{ (t.minute)--;t.second=60; }
else return;
(t.second)--;
}while(1);
}