0019【Edabit ★☆☆☆☆☆】 Less Than 100?

编程入门 行业动态 更新时间:2024-10-25 14:34:07

0019【<a href=https://www.elefans.com/category/jswz/34/1666502.html style=Edabit ★☆☆☆☆☆】 Less Than 100?"/>

0019【Edabit ★☆☆☆☆☆】 Less Than 100?

【Edabit 算法 ★☆☆☆☆☆】 Less Than 100?

language_fundamentals math validation

Instructions

Given two numbers, return true if the sum of both numbers is less than 100. Otherwise return false.

Examples
lessThan100(22, 15) // true
// 22 + 15 = 37lessThan100(83, 34) // false
// 83 + 34 = 117lessThan100(3, 77) // true
Notes
  • N/A
Solutions
function lessThan100(a, b) {return ( a + b ) < 100 ;
}
TestCases
let Test = (function(){return {assertEquals:function(actual,expected){if(actual !== expected){let errorMsg = `actual is ${actual},${expected} is expected`;throw new Error(errorMsg);}}}
})();Test.assertEquals(lessThan100(5, 57), true)
Test.assertEquals(lessThan100(77, 30), false)
Test.assertEquals(lessThan100(0, 59), true)
Test.assertEquals(lessThan100(78, 35), false)
Test.assertEquals(lessThan100(63, 11), true)
Test.assertEquals(lessThan100(37, 99), false)
Test.assertEquals(lessThan100(52, 11), true)
Test.assertEquals(lessThan100(82, 95), false)
Test.assertEquals(lessThan100(17, 44), true)
Test.assertEquals(lessThan100(74, 53), false)
Test.assertEquals(lessThan100(3, 77), true)
Test.assertEquals(lessThan100(25, 80), false)
Test.assertEquals(lessThan100(59, 28), true)
Test.assertEquals(lessThan100(69, 87), false)
Test.assertEquals(lessThan100(10, 45), true)
Test.assertEquals(lessThan100(43, 58), false)
Test.assertEquals(lessThan100(50, 44), true)
Test.assertEquals(lessThan100(74, 89), false)
Test.assertEquals(lessThan100(3, 27), true)
Test.assertEquals(lessThan100(21, 79), false)

更多推荐

0019【Edabit ★☆☆☆☆☆】 Less Than 100?

本文发布于:2023-12-04 22:45:37,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1662354.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Edabit

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!