|
|
back to boardWA#13 My code: #include <iostream> using namespace std; double fac(int n) { double l = 1.0; for(int i = 1; i <= n; i++) l *=i; return l; } double A(int m, int n) { return fac(m)/fac(m-n); } void main() { int n; double soni = 0; cin >> n;
for(int i = 2; i<=n; i++) { soni += A(n,i); }
cout.precision(0); cout << fixed << soni; } WA#13 Where is my mistake? pls help me Re: WA#13 i have met the same problem with u Re: WA#13 Precision Edited by author 28.01.2012 00:07 Edited by author 28.01.2012 00:07 Re: WA#13 primer 21=138879579704209680000 19=330665665962403980 20=6613313319248079980 Re: WA#13 0-1 2-2 3-12 4-60 5-320 6-1950 7-13692 8-109592 9-986400 10-9864090 11-108505100 12-1302061332 13-16926797472 14-236975164790 15-3554627472060 16-56874039553200 17-966858672404672 18-17403456103284402 19-330665665962403980 20-6613313319248079980 21-138879579704209680000 |
|
|