求助!!!真的大不理解
查看原帖
求助!!!真的大不理解
406817
Daaaaaaazai楼主2022/2/20 20:53

球球大佬们帮忙看看这道题

#include <bits/stdc++.h>
using namespace std;

int main()
{
	int s,v,m,t,x,a,b;
	cin>>s>>v;
	m=(8+24)*60;
	t=ceil(s/v)+10;
    if(t>=480)
    {
    	t-=480;
    	a=t/60;
    	b=t-(60*a);
    	if(a>=10)
    	{
    		if(b>=10)
    		{
    			printf("%d:%d",a,b);
    			return 0;
			}
			else
			{
				printf("%d:0%d",a,b);
				return 0;
			}
    		
		}
		else 
		{
			if(b>=10)
			{
				printf("0%d:%d",a,b);
				return 0;
			}
			else 
			{
				printf("0%d:0%d",a,b);
			}
		}
	}
	else 
	{
		x=480-t;
		a=t/60;
		b=x-(60*a);
		if(b>=10)
		{
			printf("0%d:%d",a,b);
			return 0;
		}
		else
		{
			printf("0%d:0%d",a,b);
			return 0;
		}

		
	}
	return 0;
}

嘶...0分代码,真的不知道怎么处理啊..(哭

谢谢巨佬!!!!!!

2022/2/20 20:53
加载中...