Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
九九乘法表
var i = 1, j = i, ret = '';
for(; i <= 9;) {
if(j > i) {
ret += '\n';
j = 1;
i++;
continue;
}
ret += j + ' * ' + i + ' = ' + i * j + ' ';
j++;
}
console.log(ret);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment