摘要:
题目描述:N阶楼梯上楼问题:一次可以走两阶或一阶,问有多少种上楼方式。(要求采用非递归)输入:输入包括一个整数N,(1#include long long int num=0;void search(int N){ int temp=N; if(N-1>=0) { N--; if(N==0) {num++;return;} search(N); } N++; if(N-2>=0) { N=N-2; if(N==0) {num++;return;} search(N); return; } e... 阅读全文