Cues Cues | Notes Notes |
|
One,
def look_for_key(box): for item in box: if item.is_a_box(): look_for_key(item) elif item.is_a_key(): print"found the key" two,
three,
def fact(x): if x==1: return 1 else: return x*fact(x-1)
|
Codes | |
c++ #include<iostream> using namespace std; int recursive(int a) { if(a==1) return 1; else return a*recursive(a-1); } int main() { int a=5; cout<<recursive(a)<<endl; return 0; }
|
"Algorithm graphic" chap3 recursive
Guess you like
Origin www.cnblogs.com/huangyilong/p/11449581.html
Recommended
Ranking