int ClimbStairs(int n)
{
int s0 = 1;
int s1 = 1;
while(--n > 0)
{
int temp = s0 + s1;
s0 = s1;
s1 = temp;
}
return s1;
}
#include <stdio.h>
int main(int argc, char** argv)
{
for (int i = 1; i < 22; ++i)
printf("%d stairs: %d\n", i, ClimbStairs(i));
return 0;
}