4 5
24 120
#include<iostream> using namespace std; int main() { int N; while(cin>>N) { int sum=1;int result=0; if(N<2009) { for(int i=1;i<=N;i++) { sum*=i; sum%=2009; } cout<<sum<<endl; } else cout<<0<<endl; } return 0; }
原文地址:http://blog.csdn.net/lsgqjh/article/details/44840213