```
consider the last time climb 1 step or 2 steps,so the total ways is the sum of the ways of former (n-1)and(n-2)steps.
int climbStairs(int n) {
if(n<4)return n;
int a=2,b=3,c=5;
n -= 4;
while(n--){
a=c;
c=b+c;
b=a;
}
return c;
}
```