c++70分求助!!!
查看原帖
c++70分求助!!!
987407
luolie0804楼主2023/8/6 14:11
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int s,v,t;
	cin>>s>>v;
	if(s%v==0)
	{
		t=s/v;
	}
	else
	{
		t=s/v+1;
	}
	int cft=480-t-10;
	int h=cft/60,m=cft%60;
	if(h<10&&m<10)
	{
		cout<<0<<h<<':'<<0<<m;
	}
	else if(h<10)
	{
		cout<<0<<h<<':'<<m;
	}
	else if(m<10)
	{
		cout<<h<<':'<<0<<m;	
	} 
	else
	{
		cout<<h<<':'<<m;
	}
	return 0;
}

2023/8/6 14:11
加载中...