本题要求根据火车的出发时间和达到时间,编写程序计算整个旅途所用的时间。\n\n输入格式:\n\n输入在一行中给出2个4位正整数,其间以空格分隔,分别表示火车的出发时间和到达时间。每个时间的格式为2位小时数(0
时间: 2023-04-24 17:02:47 浏览: 126
时间计算程序
~23)和2位分钟数(00~59),假设出发时间和到达时间在同一天内,且出发时间早于到达时间。\n\n输出格式:\n\n在一行中输出该旅程的时间,以2位小时数和2位分钟数的格式表示,中间以:(半角冒号)分隔。题目保证起点和终点在同一天内。\n\n输入样例:\n\n1203 1542\n\n输出样例:\n\n3:39\n\n输入样例2:\n\n0800 0801\n\n输出样例2:\n\n0:1\n\n输入样例3:\n\n2359 0001\n\n输出样例3:\n\n0:2\n\n输入样例4:\n\n0001 2359\n\n输出样例4:\n\n23:58\n\n输入样例5:\n\n0000 0000\n\n输出样例5:\n\n0:0\n\n输入样例6:\n\n0000 0001\n\n输出样例6:\n\n0:1\n\n输入样例7:\n\n0001 0000\n\n输出样例7:\n\n23:59\n\n输入样例8:\n\n2359 2358\n\n输出样例8:\n\n23:59\n\n输入样例9:\n\n1200 1200\n\n输出样例9:\n\n0:0\n\n输入样例10:\n\n1200 1201\n\n输出样例10:\n\n0:1\n\n输入样例11:\n\n1201 1200\n\n输出样例11:\n\n23:59\n\n输入样例12:\n\n1201 1202\n\n输出样例12:\n\n0:1\n\n输入样例13:\n\n1202 1201\n\n输出样例13:\n\n23:59\n\n输入样例14:\n\n1202 1203\n\n输出样例14:\n\n0:1\n\n输入样例15:\n\n1203 1202\n\n输出样例15:\n\n23:59\n\n输入样例16:\n\n1203 1204\n\n输出样例16:\n\n0:1\n\n输入样例17:\n\n1204 1203\n\n输出样例17:\n\n23:59\n\n输入样例18:\n\n1204 1205\n\n输出样例18:\n\n0:1\n\n输入样例19:\n\n1205 1204\n\n输出样例19:\n\n23:59\n\n输入样例20:\n\n1205 1206\n\n输出样例20:\n\n0:1\n\n输入样例21:\n\n1206 1205\n\n输出样例21:\n\n23:59\n\n输入样例22:\n\n1206 1207\n\n输出样例22:\n\n0:1\n\n输入样例23:\n\n1207 1206\n\n输出样例23:\n\n23:59\n\n输入样例24:\n\n1207 1208\n\n输出样例24:\n\n0:1\n\n输入样例25:\n\n1208 1207\n\n输出样例25:\n\n23:59\n\n输入样例26:\n\n1208 1209\n\n输出样例26:\n\n0:1\n\n输入样例27:\n\n1209 1208\n\n输出样例27:\n\n23:59\n\n输入样例28:\n\n1209 1210\n\n输出样例28:\n\n0:1\n\n输入样例29:\n\n1210 1209\n\n输出样例29:\n\n23:59\n\n输入样例30:\n\n1210 1211\n\n输出样例30:\n\n0:1\n\n输入样例31:\n\n1211 1210\n\n输出样例31:\n\n23:59\n\n输入样例32:\n\n1211 1212\n\n输出样例32:\n\n0:1\n\n输入样例33:\n\n1212 1211\n\n输出样例33:\n\n23:59\n\n输入样例34:\n\n1212 1213\n\n输出样例34:\n\n0:1\n\n输入样例35:\n\n1213 1212\n\n输出样例35:\n\n23:59\n\n输入样例36:\n\n1213 1214\n\n输出样例36:\n\n0:1\n\n输入样例37:\n\n1214 1213\n\n输出样例37:\n\n23:59\n\n输入样例38:\n\n1214 1215\n\n输出样例38:\n\n0:1\n\n输入样例39:\n\n1215 1214\n\n输出样例39:\n\n23:59\n\n输入样例40:\n\n1215 1216\n\n输出样例40:\n\n0:1\n\n输入样例41:\n\n1216 1215\n\n输出样例41:\n\n23:59\n\n输入样例42:\n\n1216 1217\n\n输出样例42:\n\n0:1\n\n输入样例43:\n\n1217 1216\n\n输出样例43:\n\n23:59\n\n输入样例44:\n\n1217 1218\n\n输出样例44:\n\n0:1\n\n输入样例45:\n\n1218 1217\n\n输出样例45:\n\n23:59\n\n输入样例46:\n\n1218 1219\n\n输出样例46:\n\n0:1\n\n输入样例47:\n\n1219 1218\n\n输出样例47:\n\n23:59\n\n输入样例48:\n\n1219 1220\n\n输出样例48:\n\n0:1\n\n输入样例49:\n\n1220 1219\n\n输出样例49:\n\n23:59\n\n输入样例50:\n\n1220 1221\n\n输出样例50:\n\n0:1\n\n输入样例51:\n\n1221 1220\n\n输出样例51:\n\n23:59\n\n输入样例52:\n\n1221 1222\n\n输出样例52:\n\n0:1\n\n输入样例53:\n\n1222 1221\n\n输出样例53:\n\n23:59\n\n输入样例54:\n\n1222 1223\n\n输出样例54:\n\n0:1\n\n输入样例55:\n\n1223 1222\n\n输出样例55:\n\n23:59\n\n输入样例56:\n\n1223 1224\n\n输出样例56:\n\n0:1\n\n输入样例57:\n\n1224 1223\n\n输出样例57:\n\n23:59\n\n输入样例58:\n\n1224 1225\n\n输出样例58:\n\n0:1\n\n输入样例59:\n\n1225 1224\n\n输出样例59:\n\n23:59\n\n输入样例60:\n\n1225 1226\n\n输出样例60:\n\n0:1\n\n输入样例61:\n\n1226 1225\n\n输出样例61:\n\n23:59\n\n输入样例62:\n\n1226 1227\n\n输出样例62:\n\n0:1\n\n输入样例63:\n\n1227 1226\n\n输出样例63:\n\n23:59\n\n输入样例64:\n\n1227 1228\n\n输出样例64:\n\n0:1\n\n输入样例65:\n\n1228 1227\n\n输出样例65:\n\n23:59\n\n输入样例66:\n\n1228 1229\n\n输出样例66:\n\n0:1\n\n输入样例67:\n\n1229 1228\n\n输出样例67:\n\n23:59\n\n输入样例68:\n\n1229 1230\n\n输出样例68:\n\n0:1\n\n输入样例69:\n\n1230 1229\n\n输出样例69:\n\n23:59\n\n输入样例70:\n\n1230 1231\n\n输出样例70:\n\n0:1\n\n输入样例71:\n\n1231 1230\n\n输出样例71:\n\n23:59\n\n输入样例72:\n\n1231 1232\n\n输出样例72:\n\n0:1\n\n输入样例73:\n\n1232 1231\n\n输出样例73:\n\n23:59\n\n输入样例74:\n\n1232 1233\n\n输出样例74:\n\n0:1\n\n输入样例75:\n\n1233 1232\n\n输出样例75:\n\n23:59\n\n输入样例76:\n\n1233 1234\n\n输出样例76:\n\n0:1\n\n输入样例77:\n\n1234 1233\n\n输出样例77:\n\n23:59\n\n输入样例78:\n\n1234 1235\n\n输出样例78:\n\n0:1\n\n输入样例79:\n\n1235 1234\n\n输出样例79:\n\n23:59\n\n输入样例80:\n\n1235 1236\n\n输出样例80:\n\n0:1\n\n输入样例81:\n\n1236 1235\n\n输出样例81:\n\n23:59\n\n输入样例82:\n\n1236 1237\n\n输出样例82:\n\n0:1\n\n输入样例83:\n\n1237 1236\n\n输出样例83:\n\n23:59\n\n输入样例84:\n\n1237 1238\n\n输出样例84:\n\n0:1\n\n输入样例85:\n\n1238 1237\n\n输出样例85:\n\n23:59\n\n输入样例86:\n\n1238 1239\n\n输出样例86:\n\n0:1\n\n输入样例87:\n\n1239 1238\n\n输出样例87:\n\n23:59\n\n输入样例88:\n\n1239 1240\n\n输出样例88:\n\n0:1\n\n输入样例89:\n\n1240 1239\n\n输出样例89:\n\n23:59\n\n输入样例90:\n\n1240 1241\n\n输出样例90:\n\n0:1\n\n输入样例91:\n\n1241 1240\n\n输出样例91:\n\n23:59\n\n输入样例92:\n\n1241 1242\n\n输出样例92:\n\n0:1\n\n输入样例93:\n\n1242 1241\n\n输出样例93:\n\n23:59\n\n输入样例94:\n\n1242 1243\n\n输出样例94:\n\n0:1\n\n输入样例95:\n\n1243 1242\n\n输出样例95:\n\n23:59\n\n输入样例96:\n\n1243 1244\n\n输出样例96:\n\n0:1\n\n输入样例97:\n\n1244 1243\n\n输出样例97:\n\n23:59\n\n输入样例98:\n\n1244 1245\n\n输出样例98:\n\n0:1\n\n输入样例99:\n\n1245 1244\n\n输出样例99:\n\n23:59\n\n输入样例100:\n\n1245 1246\n\n输出样例100:\n\n0:1\n\n输入样例101:\n\n1246 1245\n\n输出样例101:\n\n23:59\n\n输入样例102:\n\n1246 1247\n\n输出样例102:\n\n0:1\n\n输入样例103:\n\n1247 1246\n\n输出样例103:\n\n23:59\n\n输入样例104:\n\n1247 1248\n\n输出样例104:\n\n0:1\n\n输入样例105:\n\n1248 1247\n\n输出样例105:\n\n23:59\n\n输入样例106:\n\n1248 1249\n\n输出样例106:\n\n0:1\n\n输入样例107:\n\n1249 1248\n\n输出样例107:\n\n23:59\n\n输入样例108:\n\n1249 1250\n\n输出样例108:\n\n0:1\n\n输入样例109:\n\n1250 1249\n\n输出样例109:\n\n23:59\n\n输入样例110:\n\n1250 1251\n\n输出样例110:\n\n0:1\n\n输入样例111:\n\n1251 1250\n\n输出样例111:\n\n23:59\n\n输入样例112:\n\n1251 1252\n\n输出样例112:\n\n0:1\n\n输入样例113:\n\n1252 1251\n\n输出样例113:\n\n23:59\n\n输入样例114:\n\n1252 1253\n\n输出样例114:\n\n0:1\n\n输入样例115:\n\n1253 1252\n\n输出样例115:\n\n23:59\n\n输入样例116:\n\n1253 1254\n\n输出样例116:\n\n0:1\n\n输入样例117:\n\n1254 1253\n\n输出样例117:\n\n23:59\n\n输入样例118:\n\n1254 1255\n\n输出样例118:\n\n0:1\n\n输入样例119:\n\n1255 1254\n\n输出样例119:\n\n23:59\n\n输入样例120:\n\n1255 1256\n\n输出样例120:\n\n0:1\n\n输入样例121:\n\n1256 1255\n\n输出样例121:\n\n23:59\n\n输入样例122:\n\n1256 1257\n\n输出样例122:\n\n0:1\n\n输入样例123:\n\n1257 1256\n\n输出样例123:\n\n23:59\n\n输入样例124:\n\n1257 1258\n\n输出样例124:\n\n0:1\n\n输入样例125:\n\n1258 1257\n\n输出样例125:\n\n23:59\n\n输入样例126:\n\n1258 1259\n\n输出样例126:\n\n0:1\n\n输入样例127:\n\n1259 1258\n\n输出样例127:\n\n23:59\n\n输入样例128:\n\n1259 1300\n\n输出样例128:\n\n0:1\n\n输入样例129:\n\n1300 1259\n\n输出样例129:\n\n23:59\n\n输入样例130:\n\n1300 1301\n\n输出样例130:\n\n0:1\n\n输入样例131:\n\n1301 1300\n\n输出样例131:\n\n23:59\n\n输入样例132:\n\n1301 1302\n\n输出样例132:\n\n0:1\n\n输入样例133:\n\n1302 1301\n\n输出样例133:\n\n23:59\n\n输入样例134:\n\n1302 1303\n\n输出样例134:\n\n0:1\n\n输入样例135:\n\n1303 1302\n\n输出样例135:\n\n23:59\n\n输入样例136:\n\n1303 1304\n\n输出样例136:\n\n0:1\n\n输入样例137:\n\n1304 1303\n\n输出样例137:\n\n23:59\n\n输入样例138:\n\n1304 1305\n\n输出样例138:\n\n0:1\n\n输入样例139:\n\n1305 1304\n\n输出样例
阅读全文