软件工程爬楼梯


#include "stdafx.h"
#include<iostream>
using namespace std;ios

int _tmain(int argc, _TCHAR* argv[])
{
  int a,b,c=1;
  int m[8];
  cout<<"输入台阶数";
  cin>>a;
  m[0]=1,m[1]=2;
  for(b=2;b<a;b++)
{
 m[b]=m[b-1]+m[b-2];
 c++;
}
  cout<<m[c];
 
}c++

相关文章
相关标签/搜索