#include <stdio.h>
int step = 0;
int count;
void traceback(int foot) {
if (foot%2 == 0 && step == 39) {
count++;
return;
}
step++;
foot++;
if (step < 39) {
traceback(foot);
}
foot--;
step--;
step+=2;
foot++;
if (step <= 39)
traceback(foot);
step-=2;
foot--;
}
int main() {
traceback(0);
printf("%d", count);
return 0;
}
39阶台阶
最新推荐文章于 2022-10-23 11:31:30 发布