[求助]一个简单的时间程序
为什么分钟位,和小时位显示不了9以上的数值呢?#include <time.h>
main()
{ int i,k,j;
printf("please waite:\n");
do
{ for(j=0;j<24;j++)
for(k=0;k<=59;k++)
for(i=0;i<=59;i++)
{
sleep(1);
clrscr();
if(j==0)
{
gotoxy(2,10);
printf("0");
gotoxy(3,10);
printf("0");
}
else if(0<j<=9)
{
gotoxy(2,10);
printf("0");
gotoxy(3,10);
printf("%d",j);
}
else if(9<j<24)
{
gotoxy(2,10);
printf("%d",j);
}
gotoxy(4,10);
printf(":");
if(k==0)
{
gotoxy(5,10);
printf("0");
gotoxy(6,10);
printf("0");
}
else if(0<k<=9)
{
gotoxy(5,10);
printf("0");
gotoxy(6,10);
printf("%d",k);
}
else if(9<k<60)
{
gotoxy(5,10);
printf("%d",k);
}
gotoxy(7,10);
printf(":");
if(i<=9)
{ gotoxy(8,10);
printf("0");
gotoxy(9,10);
printf("%d",i);
}
else if(9<i<=59)
{ gotoxy(8,10);
printf("%d",i);
}
}
}while(1);
}