#include<iostream> using namespace std; int main(){ int x,y; while(cin>>x>>y){ int h=x,m; if(y>=30){ m=y-30; h=x+3; }else if(y<30){ m=y+30; h=x+2; } if(h>=24) h=h-24; if(h<10) cout<<0; cout<<h<<":"; if(m<10) cout<<'0'; cout<<m<<endl; } }
#include using namespace std; int main(){ int x,y; while(cin>>x>>y){ int h=x,m; if(y>=30){ m=y-30; h=x+3; }else if(y<30){ m=y+30; h=x+2; } if(h>=24) h=h-24; if(h<10) cout<<0; cout<<h<<":"; if(m<10) cout<<'0'; cout<<m<<endl; } }
手癢就合併了
#include <bits/stdc++.h>
using namespace std;
int a,b;
int main(int argc, char** argv){
while(cin>>a>>b){
if((a+2+(b+30>=60))%24<10)
cout<<0;
cout<<(a+2+(b+30>=60))%24<<":"<<(b+30)%60;
if(b+30==60)
cout<<0;
cout<<endl;
}
}