萌新90求助 #9一直WA 顺便求问一下WA怎么看是啥意思
查看原帖
萌新90求助 #9一直WA 顺便求问一下WA怎么看是啥意思
981986
Lalala1a楼主2023/6/1 23:35
#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
int main()
{
	double s, v;
	cin >> s >> v;
	double t = (s / v) + 11;
	double h = 8, m = 60;
	if ((t / 60) <= 8)
	{
		if (h - (int)(t / 60) != 0)
		{
			if ((int)t % 60 != 0 && (m - (int)t % 60) >= 10)
			{
				cout << "0" << (int)(h - t / 60) << ":" << m - (int)t % 60;
			}
			else if ((m - (int)t % 60) < 10)
			{
				cout << "0" << (int)(h - t / 60) << ":0" << m - (int)t % 60;
			}
			else if ((int)t % 60 == 0)
			{
				cout << "0" << (int)(h - t / 60) << ":00";
			}
		}
		else
		{
			if ((int)t % 60 != 0 && (m - (int)t % 60) >= 10)
			{
				cout << "00:" << m - (int)t % 60;
			}
			else if ((m - (int)t % 60) < 10)
			{
				cout << "00:0" << m - (int)t % 60;
			}
			else if ((int)t % 60 == 0)
			{
				cout << "24:00";
			}
		}
	}
	else if ((t / 60) > 8)
	{
		h = 24;
		if ((t / 60) <= 22)
			if ((int)t % 60 != 0 && (m - (int)t % 60) >= 10)
			{
				cout << (int)(h - t / 60 + 8) << ":" << m - (int)t % 60;
			}
			else if ((m - (int)t % 60) < 10)
			{
				cout << (int)(h - t / 60 + 8) << ":0" << m - (int)t % 60;
			}
			else if ((int)t % 60 == 0)
			{
				cout << (int)(h - t / 60 + 8) << ":00";
			}
		else if ((t / 60) > 22)
			if ((int)t % 60 != 0&& (m - (int)t % 60) >= 10)
			{
				cout << "0" << (int)(h - t / 60 + 8) << ":" << m - (int)t % 60;
			}
			else if ((m - (int)t % 60) < 10)
			{
				cout << "0" << (int)(h - t / 60 + 8) << ":0" << m - (int)t % 60;
			}
			else if ((int)t % 60 == 0)
			{
				cout << "0" << (int)(h - t / 60 + 8) << ":00";
			}
	}
}
2023/6/1 23:35
加载中...