#include <stdio.h> int main(){ int n,i; scanf("%d", &n); float sum=0, son=2, mother=1, temp; for (i=0;i<n;i++){ sum += son/mother; temp = son; son = mother + temp; mother = temp; } printf("%.2f", sum); } |
Double click to view unformatted code.