时间转换
1 #include<stdio.h> 2 3 int main(void) 4 { 5 int bjt; 6 7 scanf_s("%d", &bjt); 8 9 int bjt_hour = bjt / 100; 10 int bjt_minute = bjt % 100; 11 12 int utc_hour = bjt_hour - 8; 13 if (utc_hour < 0) 14 { 15 utc_hour = utc_hour + 24; 16 } 17 18 if (utc_hour > 0) 19 { 20 printf("%d%02d", utc_hour, bjt_minute); 21 } 22 else 23 { 24 printf("%d", bjt_minute); 25 } 26 27 return 0; 28 } 来源: https://www.cnblogs.com/2018jason/p/11796857.html