0分代码求助C++
查看原帖
0分代码求助C++
69851
桐坂千座楼主2023/8/16 13:22
#include<iostream>
using namespace std;
int main()
{
	int hh=7,mm=50;
	int s,v;
	cin>>s>>v;
	int t;
	while(s>0)
	{
		s-=v;
		t+=1;
	}
	while(t>0)
	{
		if(mm<t)
		{
			mm+=60;
			if(hh==0)
			{
				hh=24;
			}
			hh-=1;
		}
		else
		{
			mm-=t;
			t=0;
		}
	}
	if(hh<10)
	{
		cout<<"0";
	}
	cout<<hh<<":";
	if(mm<10)
	{
		cout<<"0";
	}
	cout<<mm;
	return 0;
}

本地跑样例没有问题,但是上传后没有测试点通过,符号试过错没有影响。

2023/8/16 13:22
加载中...