#include<iostream>
#include<string.h>
using namespace std;
int n,i,fact;
int factorial( int n );
main (){
cout<<"ingrese numero:"<<endl;
cin>>n;
if(n<1){
cout<<"ERROR, intente de nuevo"<<endl;
}
else
cout<<"\n factorial:"<<factorial(n)<<"\n"<<endl;
system("pause");
}
int factorial(int n){
int fact=1;
for(n;n>=1;n--)
{
fact=fact*n;
}
return(fact);
}