c=(60*a)+b;
c=c+150;
a=c/60;
if(a>=24) a-=24;
b=c%60;
if(a<10 && b==0) {cout<<"0"<<a<<":"<<"0"<<b<<endl; break;}
else if(a<10) {cout<<"0"<<a<<":"<<b<<endl; break;}
else if(b==0) {cout<<a<<":"<<"0"<<b<<endl; break;}
else {cout<<a<<":"<<b<<endl; break;}
}
硬算XD
c=(60*a)+b;
c=c+150;
a=c/60;
if(a>=24) a-=24;
b=c%60;
if(a
else if(a<10) {cout<<"0"<<a<<":"<<b<<endl; break;}
else if(b==0) {cout<<a<<":"<<"0"<<b<<endl; break;}
else {cout<<a<<":"<<b<<endl; break;}
}
硬算XD
#include <iostream>
using namespace std;
int main()
{
int a,b,c,d;
cin>>a>>b;
c=((a*60+b+150)/60)%24;
d=(a*60+b+150)%60;
if(c>=10&&d>=10)
cout<<c<<":"<<d;
else if(c>=10&&d<=10)
cout<<c<<":"<<"0"<<d;
else if(c<=10&&d>=10)
cout<<"0"<<c<<":"<<d;
else if(c<=10&&d<=10)
cout<<"0"<<c<<":"<<"0"<<d;
}
暴力解
c=(60*a)+b;
c=c+150;
a=c/60;
if(a>=24) a-=24;
b=c%60;
if(a
else if(a<10) {cout<<"0"<<a<<":"<<b<<endl; break;}
else if(b==0) {cout<<a<<":"<<"0"<<b<<endl; break;}
else {cout<<a<<":"<<b<<endl; break;}
}
硬算XD
#include
using namespace std;
int main()
{
int a,b,c,d;
cin>>a>>b;
c=((a*60+b+150)/60)%24;
d=(a*60+b+150)%60;
if(c>=10&&d>=10)
cout<<c<<":"<<d;
else if(c>=10&&d<=10)
cout<<c<<":"<<"0"<<d;
else if(c<=10&&d>=10)
cout<<"0"<<c<<":"<<d;
else if(c<=10&&d<=10)
cout<<"0"<<c<<":"<<"0"<<d;
}
暴力解
有ac