Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int niza[400];
- double neprekinata_dropka(int i, double broj) {
- if(i == 0) {
- return broj;
- }
- return neprekinata_dropka(i - 1, 1.0 / (broj + niza[i]));
- }
- int main() {
- int n;
- scanf("%d", &n);
- for(int i = 0; i < n; i++) {
- scanf("%d", &niza[i]);
- }
- printf("%lf\n", niza[0] + neprekinata_dropka(n - 1, 0.0));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement