码迷,mamicode.com
首页 > 其他好文 > 详细

软件工程爬楼梯

时间:2017-03-07 22:53:06      阅读:145      评论:0      收藏:0      [点我收藏+]

标签:int   stream   char   ace   爬楼梯   tchar   std   [1]   for   


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

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];
 
}

软件工程爬楼梯

标签:int   stream   char   ace   爬楼梯   tchar   std   [1]   for   

原文地址:http://www.cnblogs.com/wangyulino6o6/p/6517002.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!