C语言90分求助,第九个过不了
查看原帖
C语言90分求助,第九个过不了
837607
adhassic楼主2023/1/23 23:31
#include<stdio.h>
#include<string.h>

int main(void)

{
	int s, v;
	scanf("%d%d", &s, &v);
	int t = s / v;
	
	
	int t1 = (t + 10) / 60;
	if (t <= 480)
	{
		int h = 7;
		if (t / 60 >= 0)
		{
			t = t - t1 * 60;
		}
		int a = 60 - t - 10;
		if (a >= 10)
		{
			printf("0%d:%d", h - t1, a-1);
		}
		else if (a < 10&&a>=1)
		{
			printf("0%d:0%d", h - t1, a-1);
		}
		else if (a == 0)
		{
			printf("0%d:59", h - t1 - 1);
		}
	}
	else
	{
		int h = 31;
		if (t / 60 >= 0)
		{
			t = t - t1 * 60;
		}
		int a = 60 - t - 10;
		if (a >= 10)
		{
			printf("%d:%d", h - t1, a-1);
		}
		else if (a < 10&&a>=1)
		{
			printf("%d:0%d", h - t1, a-1);
		}
		else if (a == 0)
		{
			printf("%d:59", h - t1 - 1);
		}
	}
	
	

	return 0;
}
2023/1/23 23:31
加载中...