本地输出是乱码,洛谷直接就Too Short,有没有好心人看一下
查看原帖
本地输出是乱码,洛谷直接就Too Short,有没有好心人看一下
225797
ytyuhuan楼主2022/9/20 23:01

提交记录


#include <iostream>
#include <cmath>
using namespace std;
int s,v;
int h;
int main()
{
	cin>>s>>v;
	int s=(int)s/v+11;
	if(s<60) cout<<"07:"+(60-s)<<endl;
	else
	{
		int sum=0;
		while(s>0)
		{
			sum++;
			s-=60;
		}
		if(s==0)
		{
			if(8-sum<0)
			{
				h=24-sum+8;
				if(h<10) cout<<"0"<<h<<":00"<<endl;
				else cout<<h<<":00"<<endl;
			}
			else cout<<"0"<<8-sum<<":00"<<endl;
		}
		else
		{
			if(8-sum<0)
			{
				h=24-sum+8;
				if(h<10) cout<<"0"<<h<<":"<<s<<endl;
				else cout<<h<<":"<<s<<endl;
			}
			else cout<<"0"<<8-sum<<":"<<s<<endl;
		}
	}
	return 0;
}
2022/9/20 23:01
加载中...