Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const n1 = prompt ("Podaj pierwszą liczbę"); //a
- const n2 = prompt ("Podaj drugą liczbę"); //b
- const n3 = prompt ("Podaj trzecią liczbę"); //c
- if (n1 < n2 && n1 < n3) //a
- {
- document.write (n1 + " ");
- if (n1 < n2 && n2 < n3) //a b c
- {
- document.write (n2 + " " + n3);
- }
- else if (n1 < n2 && n2 > n3) // a c b
- {
- document.write (n3 + " " + n2);
- }
- }
- else if (n2 < n1 && n2 < n3) //b
- {
- document.write (n2 + " ");
- if (n2 < n1 && n1 < n3) //b a c
- {
- document.write (n1 + " " + n3);
- }
- else if (n2 < n3 && n3 < n1) //b c a
- {
- document.write (n3 + " " + n1);
- }
- }
- else if (n3 < n1 && n3 < n2) //c
- {
- document.write (n3 + " ");
- if (n3 < n1 && n1 < n2) //c a b
- {
- document.write (n1 + " " + n2);
- }
- else if (n3 < n1 && n2 < n1) //c b a
- {
- document.write (n2 + " " + n1);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement