利用1234组成不重复的三位数:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<script type="text/javascript">
for(var a = 1;a <= 4;a ++) {
for(var b = 1;b <=4;b ++) {
for(var c = 1;c <=4 ;c ++) {
if(a != b && b != c && a != c) {
document.write(a * 100 + b * 10 + c + '<br />');
}
}
}
}
</script>
</body>
</html>
输出结果: