Saturday 21 March 2009

HOJ ( acm.hdu.edu.cn ) 2048





#include<iostream>
using namespace std;
int main()
{
int n,m,N;
double t;
for(cin>>N;N--;)
{
cin>>n;t=1;
for(m=n-1;m>=1;--m)
{
t*=double(m)/(m+1);
}
cout.precision(2);
cout<<fixed<<(t*100)<<"%"<<endl;
}
return 0;
}

No comments:

Post a Comment