NC15531. Unpredictable Accidents
描述
输入描述
The first line contains an integer number T,the number of test cases.ith of each next T lines contains an integer x(1≤x≤300), the number of minutes competition will postpone.
输出描述
For each test case print the the ending time in the form of hh:mm.
示例1
输入:
3 5 70 120
输出:
12:05 13:10 14:00
C 解法, 执行用时: 2ms, 内存消耗: 356K, 提交时间: 2021-06-24 12:01:25
#include <stdio.h> int main () { int n,t; scanf("%d",&n); while(n--) { scanf("%d",&t); printf("%d:%02d\n",12+t/60,t%60); } return 0; }
C++11(clang++ 3.9) 解法, 执行用时: 3ms, 内存消耗: 464K, 提交时间: 2018-04-14 17:23:44
#include"stdio.h" int main() { int t,sj; scanf("%d",&t); while(t--) { scanf("%d",&sj); printf("%d:%.2d\n",12+sj/60,sj%60); } return 0; }
Python3(3.5.2) 解法, 执行用时: 19ms, 内存消耗: 3320K, 提交时间: 2020-10-10 20:02:48
a=int(input()) for i in range(a): b=int(input()) c=b//60+12 c=c%24 b=b%60 print('{:02d}:{:02d}'.format(c,b))