90分求助哇
查看原帖
90分求助哇
1101832
dkp339楼主2023/9/22 23:59

我是刚学c语言的大一新生,不过一直卡在90分不过,大佬能不能帮忙看一下是哪里出了问题吗? 以下是源代码

#include <stdio.h>
#include <math.h>

int main()
{
	int s,v,at,H,T;
	double t;
	scanf("%d %d",&s,&v);
	t = s/v;
	at = (t+1) + 10;
	if (at<=480)
	{
		H=(480-at)/60;
		T=(480-at)%60;
		printf("%.2d:%.2d\n",H,T);
	}
	else if (at>480)
	{
		H=(1920-at)/60;
		T=(1920-at)%60;
		printf("%.2d:%.2d\n",H,T);
	}
	return 0;
}
2023/9/22 23:59
加载中...