#include <iostream>#include <vector>int _tmain(int argc, _TCHAR* argv[]){ using namespace std;const _int64 LargeNumber=100000000;vector<_int64> a(1,1);_int64 i,n,temp,pro=0;cout<<"input an integer:"<<endl;cin>>n;vector<_int64>::iterator iter;for(i=1;i<=n;i++){ for(iter=a.begin();iter!=a.end();++iter) { temp=(*iter)*i+pro; *iter=temp%LargeNumber; pro=temp/LargeNumber; } if(pro!=0) a.push_back(pro); pro=0;}for(iter=--(a.end());iter!=a.begin();--iter){
cout<<*iter<<" ";
cout.width(8);
cout.fill('0');
}
cout.width(8);
cout.fill('0');cout<<*iter<<endl;return 0;}