Advertisement
Guest User

Untitled

a guest
Nov 18th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. function z3(){
  2. let kg = 0
  3. let i = 0
  4. while(kg<=200){
  5. a = parseInt(prompt("Jaką wagę ma paczka?: "))
  6. kg += a;
  7. i++;
  8. }
  9.  
  10. if(kg>=200){
  11. document.write("Waga twoich ")
  12. document.write(i)
  13. document.write(" paczek wynosi: ")
  14. document.write(kg)
  15. document.write(" ,co przekroczyło dopuszczalny limit")
  16. }
  17. }
  18.  
  19. function z4(){
  20. let a = parseInt(prompt("Podaj a"));
  21. let b = parseInt(prompt("Podaj b"));
  22. let pom = 0;
  23.  
  24. while (a != b) {
  25. if (a < b) {
  26. pom = a; a = b; b = pom;
  27. }
  28. a = a - b;
  29. }
  30. document.write("NWD: ");
  31. document.write(a);
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement