初学者,只会一些基础的,改了很久,还是不满分,求大佬指教。
查看原帖
初学者,只会一些基础的,改了很久,还是不满分,求大佬指教。
1768853
luggage楼主2025/6/25 07:03

include

using namespace std; main() { int s,v,t,tt,a,b; cin>>s>>v; if(s%v==0) { t=s/v+10; } else { t=s/v+11; } if(t<=480) { tt=480-t; a=tt/60;

# include <iostream>
using namespace std;
main() {
	int s,v,t,tt,a,b;
	cin>>s>>v;
		if(s%v==0) {
			t=s/v+10;
		} else {
			t=s/v+11;
		}
		if(t<=480) {
			tt=480-t;
			a=tt/60;
			b=tt%60;
		} else {
			tt=1440-(t-480);
			a=tt/60;
			b=tt%60;
		}
		if(a<10&&b<10) {
			cout<<"0"<<a<<":"<<"0"<<b;
		}
		if(a<10&&b>10) {
			cout<<"0"<<a<<":"<<b;
		}
		if(a>10&&b<10) {
			cout<<a<<":"<<"0"<<b;
		}
		if(a>10&&b>10){
			cout<<a<<":"<<b;
	}
}
		b=tt%60;
	} else {
		tt=1440-(t-480);
		a=tt/60;
		b=tt%60;
	}
	if(a<10&&b<10) {
		cout<<"0"<<a<<":"<<"0"<<b;
	}
	if(a<10&&b>10) {
		cout<<"0"<<a<<":"<<b;
	}
	if(a>10&&b<10) {
		cout<<a<<":"<<"0"<<b;
	}
	if(a>10&&b>10){
		cout<<a<<":"<<b;
}

}

2025/6/25 07:03
加载中...