Code minh ne

mail@pastecode.io avatar
unknown
plain_text
3 years ago
391 B
232
Indexable
Never
#include<iostream> 
#include<iomanip>  
#include<math.h>   

using namespace std; 

double sum4(double n){ 
	double res = 2*(1-(1/(n+1))); 
	return res;
}

int main(){ 
	double n, arr[100000]; 
	cin >> n;   
	
	for(int i = 1; i <= n; i++){ 
		cin >> arr[i];
	}  
	for(int i = 1; i <= n; i++){ 
		cout << setprecision(8) << fixed << sum4(arr[i]) << endl;
	} 
return 0;
}