Masala #UVI4L5FNVN
For #23
n butun soni va x haqiqiy soni berilgan (n > 0). Quyidagi yig’indini hisoblovchi dastur tuzing. (Olingan natija taxminan sin(x) ga yaqinlashadi)
\(x- x^3 / 3! + x^5 / 5! -... +(-1)^nx^{2*n+1} /(2*n+1)!\)
( 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 |
2 1.3 |
0.96477442 |
2 |
2 -1.3 |
-0.96477442 |