|
|
back to boardShow all messages Hide all messages#include <iostream> using namespace std; int main() { int n; cin >> n; //if(n==1) { cout << 0 << endl; return 0; } unsigned long long p,s=0; for(int i=2;i<=n;i++) { p=1; for(int j=n;j>=n-i+1;j--) p*=j; s+=p; cout << p << " "; } cout << endl; cout << s << endl; //system("Pause"); return 0; } Edited by author 30.08.2008 20:06 Edited by author 30.08.2008 20:08 test 13 is 21 the correct answer is 4131306270 N = 21 ANS = 138879579704209680000 =) |
|
|