plamen1982

triangle-january-2018-0-points

Apr 1st, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. function triangle(args) {
  2. let a = Number(args[0])
  3. let b = Number(args[1])
  4. let c = Number(args[2])
  5. if(a < (b + c) && b < (a + c) && c <(a + b)) {
  6. if(a == b && a == c) {
  7. console.log(`Triangle with sides ${a}, ${b} and ${c} is equilateral.`)
  8. } else if(a == b || a == c || b == c) {
  9. console.log(`Triangle with sides ${a}, ${b} and ${c} is isosceles.`)
  10. } else {
  11. console.log(`Triangle with sides ${a}, ${b} and ${c} is scalene.`)
  12. }
  13. } else {
  14. console.log(`There is no triangle with sides ${a}, ${b} and ${c}.`)
  15. }
  16. }
  17.  
  18. triangle(["3" , "4", "5"])
Advertisement
Add Comment
Please, Sign In to add comment