#include<iostream>
#include<iomanip>
using namespace std;
double anik(double n, double r)
{
if(n == 0 && r!=0)
return 0;
if (r == 0)
return 1;
else if(r == 1)
{
return n;
}
else
{
return n/r * anik(n-1, r-1);
}
}
int main()
{
double a, b, r;
cin >> a >> b;
r = anik(a, b);
cout << fixed;
cout << setprecision(0);
cout << r << endl;
return 0;
}
#include<iomanip>
using namespace std;
double anik(double n, double r)
{
if(n == 0 && r!=0)
return 0;
if (r == 0)
return 1;
else if(r == 1)
{
return n;
}
else
{
return n/r * anik(n-1, r-1);
}
}
int main()
{
double a, b, r;
cin >> a >> b;
r = anik(a, b);
cout << fixed;
cout << setprecision(0);
cout << r << endl;
return 0;
}
Comments
Post a Comment