标签:des style blog http io color ar os sp
1 #include<stdio.h> 2 int x=0; 3 void dfs(int m,int n,int step) 4 { 5 if(step==m && n==0) 6 { 7 x++; 8 } 9 if(n==0) 10 return; 11 if(step+1<101) 12 dfs(m,n-1,step+1); 13 if(step-1>0) 14 dfs(m,n-1,step-1); 15 } 16 int main() 17 { 18 int m,n,k; 19 x=0; 20 while(scanf("%d %d %d",&m,&n,&k)!=EOF) 21 { 22 dfs(m,n,k); 23 printf("%d\n",x); 24 x=0; 25 } 26 return 0; 27 }
标签:des style blog http io color ar os sp
原文地址:http://www.cnblogs.com/wangrunwen/p/4083202.html