Advertisement
JakubJaneczek

z9

Nov 27th, 2020
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script>
  2. var a=prompt("Podaj pierwszą liczbe");
  3. var b=prompt("Podaj drugą liczbe");
  4. var c=prompt("Podaj trzecia liczbe");
  5.  
  6. if(a<b && a<c)
  7. {
  8.     document.write("Kolejność to: "+a);
  9.     if(b<c)
  10.     {
  11.         document.write(b+c);
  12.     }
  13.     else
  14.     {
  15.         document.write(c+b);
  16.     }
  17. }
  18. else if(b<a && b<c)
  19. {
  20.     document.write("Kolejność to: "+b);
  21.     if(a<c)
  22.     {
  23.         document.write(a+c);
  24.     }
  25.     else
  26.     {
  27.         document.write(c+a);
  28.     }
  29. }
  30. else if (c<a && c<b)
  31. {
  32.     document.write("Kolejność to: "+c);
  33.     if(b<a)
  34.     {
  35.         document.write(b+a);
  36.     }
  37.     else
  38.     {
  39.         document.write(a+b);
  40.     }  
  41. }
  42. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement