#54783: c++解答


yp11451009@yphs.tp.edu.tw (711-19王敬皓)


c++

 

#include<bits/stdc++.h>
using namespace std;
int main(){
    int h,m,s,t;
    while(cin>>h>>m>>s>>t){
        m=h*60+m+90 *t;
        h=(m+2160)%2160/60;
        m=(m+2160)%2160%60;
        cout<<h<<':'<<setw(2)<<setfill('0')<<m<<':'<<setw(2)<<setfill('0')<<s<<endl;
    }
}