Why cant i get the factorials correct?

#include

using namespace std;

int factorial(int n){
int ans=1;
for(int i=1; i<=n; i++){

    ans=ans*i;
}
return ans;

}

int main()
{
int n,r,k=n-r;
cin>>n>>r;
n=factorial(n);
r=factorial®;
k=factorial(k);
cout<<n<<endl<<r<<endl<<k;
return 0;
}