int main(int args, char * arg[])
{
int result = 1;
int n = 10;
int i = 0;
for(i = 0; i<=n; i++)
{
if(i == 0)
result = 1;
esle
result = result * i;
}
printf("%d", result);
return 0;
}
#include<iostream> using namespace std; int main() { int i,n; int result=1; cout<<"please input the number:"; cin >>n; if(n==0)result=1; else for(i=1;i<=n;i++) result=result*i; cout<<"result="<<result<<endl; return 0;