本帖最后由 terry182 于 2013-4-4 20:26 编辑int top=1,lr=2;while (--n){ int temp=lr;lr+=top*2;top+=temp;}cout << top+lr << endl;第3題大概就是這樣吧。
本帖最后由 terry182 于 2013-4-4 20:26 编辑
int top=1,lr=2;
while (--n)
{ int temp=lr;
lr+=top*2;
top+=temp;
}
cout << top+lr << endl;
第3題大概就是這樣吧。