题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2033
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 64329 Accepted Submission(s): 41979
1 #include <iostream> 2 #include <algorithm> 3 using namespace std; 4 int n; 5 int a[6]; 6 int main() 7 { 8 while(cin>>n){ 9 while(n--){ 10 int sum=0; 11 for(int i=0;i<6;i++){ 12 cin>>a[i]; 13 if(i==0||i==3) sum+=3600*a[i]; 14 else if(i==1||i==4) sum+=60*a[i]; 15 else sum+=a[i]; 16 } 17 cout<<sum/3600<<" "; 18 sum%=3600; 19 cout<<sum/60<<" "; 20 sum%=60; 21 cout<<sum<<endl; 22 } 23 } 24 return 0; 25 }
原文:https://www.cnblogs.com/shixinzei/p/10674369.html