Created
December 5, 2016 08:40
-
-
Save tonkec/05fd191279a4e9d658a3f04095d7b6bf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function a(k) { | |
var k,i,s,j; | |
for (i=1;i<=k;i++) { | |
s=0; | |
console.log("prva##############") | |
console.log("i je: " + i) | |
console.log("j je:" +j) | |
console.log("s je:" +s) | |
for (j=1;j<i;j++) { | |
console.log("druga###########################") | |
console.log("i je: " + i) | |
console.log("j je:" +j) | |
console.log("s je:" +s) | |
if (i%j==0) { | |
console.log("IF########") | |
console.log("i je: " + i) | |
console.log("j je:" +j) | |
s=s+j | |
console.log("s je:" +s) | |
}; | |
} | |
//console.log(s) | |
if (i<s) {console.log(i)}; | |
} | |
return 0; | |
} | |
a(12) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment