Problem Comments
-
12 Comments
TestSuite输入不会遵循输入格式字符串。
Having a hard time with the test suite regarding the number of hours in one year. I think it should be 8 765.81277h/y
测试套件不遵循。这应该是数天和月的两位数,而不是按他的描述
having problems with the test suite especially test no 3
在测试套件的第3号测试中遇到问题,为什么?
It's a fun problem
测试诉讼全部通过,但是数学网络说明了它的错误。
and the size is '-1'.
我使用Datenum功能。
I use format bank to get 2 decimal output, anyone has a better idea?
using existing functions makes this trick easy
有了现有的功能,这是可以解决的
函数大量= elapsed_time(d1,d2)
d1='2010/12/14 12:00:00'
d2 ='2010/12/15 13:06:36'
a=(str2num(d2(1:4))-str2num(d1(1:4)))*8760;
b =(str2num(d2(6:7)) - str2num(d1(6:7)))*720;
c=(str2num(d2(9:10))-str2num(d1(9:10)))*24;
e = str2num(d2(12:13)) - str2num(d1(12:13));
f=(str2num(d2(15:16))-str2num(d1(15:16)))/60;
g =(str2num(d2(18:19)) - str2num(d1(18:19)))/3600;
elapsed=a+b+c+e+f+g
结尾
它告诉我解决方案是错误的吗?
Nice question
解决方案评论
-
1条评论
该测试程序是错误的。要判断leap年,您需要计算以下条件是否满足mod(4)== 0&mod(Year,100)〜= 0&mod(年,400)==0。但是,这个团队只计算那些年份(年度4)== 0的年份
-
1条评论
为什么此功能返回错误,它在我的PC上完美工作
-
1条评论
测试诉讼全部通过,但是数学网络说明了它的错误。and the size is '-1'. i use the datenum function.
-
1条评论
测试套件#3中D1的值不是规格(一个月的一位)。
-
1条评论
Love the little "if" in the end ! :D
-
1条评论
不再起作用