各位大神,我写的这个代码还有没有更简单的写法?有的话怎么写?[em03]
#include<stdio.h>int main()
{
int n, H, M, h, UTC;
scanf("%d", &n);
if(0<=n<=2359)
{
H=n/100;
M=n%100;
if(H>=0&&H<=23)
{
if(M>=0&&M<=59)
{
if(H<8)
{
h=24+H-8;
UTC=h*100+M;
printf("%d", UTC);
}
else
{
h=H-8;
UTC=h*100+M;
printf("%d", UTC);
}
}
}
}
}