Masala #PEQDIU8YUR
For #22
n butun soni va x haqiqiy soni berilgan (n > 0). Quyidagi yig’indini hisoblovchi dastur tuzing. (Olingan natija taxminan \(e^x\) ga yaqinlashadi)
\(1 +x/1! + x^2/2! + x^3/3!+ ... +x^n/ n!\)
( Massivdan yoki [ ] amaldan foydalanmang kodda! )
Birinchi qatorda n butun son kiritiladi. 1≤n≤1000
Ikkinchi qatorda x haqiqiy son kiritiladi. |x|<1
Masala javobini namunadagidek chop eting.
# | input.txt | output.txt |
---|---|---|
1 |
3 0.42 |
1.52054800 |
2 |
7 -0.14 |
0.86935824 |