Untitled

mail@pastecode.io avatar
unknown
plain_text
3 years ago
236 B
316
Indexable
Never
#include<iostream> 
#include<iomanip> 
using namespace std; 

int main(){  
	double n;  
	double sum = 0; 
	cin >> n;
	for(double i = 1; i <= n; i++){ 
		sum += (1/(i*(i+1)));
	}  
	cout << setprecision(5) << fixed << sum;
}