从我做起振
我做起振兴
做起振兴中
起振兴中华
>
很显然 这是 一个用dfs 深搜的 题目
很简单
#include<iostream>
int count1 = 0;
void f(int x, int y){
if(x == 4 && y == 3 ){
count1 ++;
return;
}
if(x + 1 < 5 )
f(x + 1, y);// 横向扫描
if(y + 1< 4)
f(x, y + 1);// 纵向扫描
}
int main(){
// 从我做起 振兴中华
f(0, 0);
cout << count1 << endl;
}
答案为: 35种