Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- var x, y;
- var a = '1';
- var b = '9';
- function PODZIELNOSC() {
- x = prompt("Podaj ilocyfrowe liczby Cię interesują");
- y = prompt("Podaj przez co mają być podzielne");
- if (x == 1) {
- document.write("Twoje liczby to: ");
- for (x = 1; x <=9; x++){
- if (x%y == 0) {
- document.write(x+ " ");
- }
- }
- }
- else if (x <= 0 || y <= 0) {
- document.write("Co ty próbujesz zrobić?")
- }
- else {
- document.write("Twoje liczby to: ");
- for (let i = 1; i < x; i++) {
- a = a.concat('0');
- b = b.concat('9');
- }
- a = parseInt(a);
- b = parseInt(b);
- for (let j = a; j <= b; j++) {
- if (j%y == 0) {
- document.write(j+ " ");
- }
- }
- }
- }
- PODZIELNOSC();
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement