|
|
back to boardwhat's wrong with my code? #include <iostream> #include <cmath> using namespace std; int fac(int n){ if (n==0){ return 1; } else { return n*fac(n-1); } } int wtf(int n,int k){ return fac(n)/fac(n-k); } int cock(int n){ int sum; for (int i=2;i<=n;i++){ sum += wtf(n,i); } return sum; } int main() { int n; cin >> n; cout << cock(n); return 0; } |
|
|