递归出题

This commit is contained in:
asd
2021-04-09 16:36:34 +08:00
parent 71190d870d
commit 812be57880
28 changed files with 1834 additions and 227 deletions

View File

@@ -0,0 +1,45 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script>
function jiecheng(n){
if(n==1){
return 1
}else{
console.log(arguments.callee)
return n*arguments.callee(n-1)
// 5*5-1 5*4
// 5*4*3
// 5*4*3*2
// 5*4*3*2*1
}
}
// 5*4*3*2*1
// function jc(n){
// if(n==1){
// return 1
// }else{
// return n*a(n-1)
// // 5*5-1 5*4
// // 5*4*3
// // 5*4*3*2
// // 5*4*3*2*1
// }
// }
var jc=jiecheng
jiecheng=null
var sum=jc(5) //120
console.log(sum)
</script>
</head>
<body>
</body>
</html>