MarcinKrol

Zad 12 - JS

Nov 24th, 2020
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. const first = prompt('Podaj długość pierwszego odcinka:') * 1;
  2. const second = prompt('Podaj długość drugiego odcinka:') * 1;
  3. const third = prompt('Podaj długość trzeciego odcinka:') * 1;
  4.  
  5. document.write(`Wybrałeś odcinki o długości: ${first}, ${second}, ${third} <br>`);
  6.  
  7.  
  8. if ((first+second) > third && (first+third) > second && (second+third) > first) {
  9. document.write('I można utworzyć z nich trójkąt');
  10. }
  11. else{
  12. document.write('I nie można utworzyć z nich trójkąta');
  13. }
Add Comment
Please, Sign In to add comment