-->
当前位置:首页 > 题库

PROGRAMMING:Xiao Ming walks on the grid

Luz5年前 (2021-05-10)题库374
There are n squares from point a to point B. now Xiaoming wants to go from point a to point B. Xiaoming has eaten something to replenish his physical strength. He can step one grid at a time, two grids at a time, three grids at a time, or four grids at a time. Please write a program to calculate how many ways Xiao Ming has from point a to point B.
![ grid2.jpg](~/91716067-86a3-40f1-9c0d-4e557ac8c79f.jpg)
###Input format:
The input contains multiple groups of data, the first line is an integer m, m does not exceed 10000, indicating the number of input data groups. Next, m lines, each line is an integer n (ensure that the corresponding output result is less than $$2 ^ {31} $$), which represents the number of grids from point a to point B.
###Output format:
The output is m integers, representing the number of Xiaoming's walk from point a to point B for each group of data.
###Input example:
```in
two
five
three
```
###Output example:
```out
fifteen
four
```







answer:If there is no answer, please comment