all right,here is a c problem
#include<stdio.h>int main()
{
int a,b,c,d;
while(scanf("%d:%d",&a,&b)!=EOF)
{
if(a<=12&&b<60)
c=a;
printf("%d:%d\n",c,b);
if(a>12&&a<=24&&b<60)
c=a-12;
printf("%d:%dPM\n",c,b);
if(b>=60)
printf("输入时间不合理.\n");
}
return 0;
}
while input a number , change into a 24 hour form.