Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- long long fact (int a)
- {
- long long l=1;
- if (a==0 || a==1)
- l=1;
- else for (int i=2; i<a+1; i++)
- l*=i;
- return l;
- }
- int main()
- {
- long long res=0;
- int a=0, b=0;
- cin >> a >> b;
- if (a-b>=0)
- {
- res = fact(a)/(fact(b)*fact(a-b));
- cout << res;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement