#if _WIN32_WINNT < 0x0500
#undef _WIN32_WINNT
#define _WIN32_WINNT 0x0502 // I've got SP2
#endif
#include <iostream>
#include <windows.h>
long long CMN(int m, int n)
{
if((m==0) ||m==n) return 1;
else return CMN(m,n-1)+CMN(m-1,n-1);
}
int main()
{
HWND hcon = GetConsoleWindow();
MoveWindow(hcon,401,1,400,120,TRUE);
system("color b4");
system("title C(M,N)");
int M,N;
std::cout<<"M = ";
std::cin>>M;
std::cout<<"N = ";
std::cin>>N;
std::cout<<"C(M,N) = "<<CMN(M,N)<<std::endl;
system("pause");
return 0;
}
|