show my code to help you understand it

whutshiliu Reply 13 weeks 6 days ago
#include<iostream> #include<cmath> using namespace std; int main() { int n; cin>>n; while(n--) { double p; cin>>p; double result=(2*p-p*p)/(1-p)+(1-p*p)/p; //cout<<result<<endl; cout<<round(result)<<endl; } }