#include <stdio.h>
#include <stdlib.h>
// only can move right and down. Matrix mxn, how many ways from point(0,0) to point(m,n)
int ways(int m, int n)
{
if( 0==n && 0==m) return 0;
if( 0==n || 0==m ) return 1;
return ( ways(m-1, n) + ways(m,n-1) );
}
int main(void)
{
int m=0,n=0,ways_sum=0;
printf("please input the value of m=\n");
scanf("%d", &m);
printf("please input the value of n=\n");
scanf("%d",&n);
ways_sum = ways(m,n);
printf("ways_sum = %d\n", ways_sum );
return 0;
}