60分求助
查看原帖
60分求助
577263
sea_bird楼主2023/9/11 13:43

	int s,v,t,rt,h,m;
	cin>>s>>v;
	t=8*60;
	rt=s/v;
	if(s%v>0)
	{
		rt+=1;
	}
	t=t-10-rt;
	
	/***********************************/
	if(t<0)
	{
	t=12*60;
	rt=s/v-480;
	if(s%v>0)
	{
		rt+=1;
	}
	t=t-10-rt;
	}
	h=t/60;
	m=t%60;
	if(t/60==0)
	{
		h=12;
	}
	if(h<=9&&m>=10)//小时为一位数 
	{
	cout<<"0"<<h<<":"<<m<<endl;	
	}
	if(h>9&&m>=10)//皆为两位数 
	{
	cout<<h<<":"<<m<<endl;	
	}
	if(h<=9&&m<10)//皆为一位数 
	{
	cout<<"0"<<h<<":0"<<m<<endl;	
	}
	if(h>9&&m<10)//分钟为一位数 
	{
	cout<<h<<":0"<<m<<endl;	
	}

问题在哪

2023/9/11 13:43
加载中...