第九个点过不去!求助大佬
查看原帖
第九个点过不去!求助大佬
683859
complete_binary_tree楼主2022/4/30 12:44

有特判鸭

#include<bits/stdc++.h>
using namespace std;
int main(){
	int s,v;
	cin>>s>>v;
	int t = 8*60-10-s/v;
	int hh,mm;
	if(t == 0 || t == -24*60){
		cout<<"00:00";
        return 0;
	}else{
		if(t < 0){
			t = t+24*60;
			hh = t/60;
			mm = t%60;
		}else{
			hh = t/60;
			mm = t%60;
		}
		if(mm < 0 & t%60 != 0){
			hh--;
		}
		if(hh < 10){
			cout<<"0"<<hh;
		}else{
			cout<<hh;
		}
		cout<<":";
		if(t%60 == 0){
			if(mm < 10){
				cout<<"0"<<mm;
			}else{
				cout<<mm;
			}
		}else{
    	    if(mm < 11){
    	    	if(mm-1 < 0){
				    cout<<59;
			    }else{
			    	cout<<"0"<<mm-1;
				}
			}else{
				cout<<mm-1;
			}
		}
	}
	return 0;
}

卡了几天了

2022/4/30 12:44
加载中...