Who wants to be a Millionaire?-Hackerearth
C++14 Solution
#include <iostream>
#include <stdio.h>
using namespace std;
int main() {
int test;
cin >> test;
while (test--) {
int n;
cin >> n;
printf ("%.6f\n", (float)(n-1)*1.0/(float)(n));
}
return 0;
}
Try this on Hackerearth
For more Hackerearth Problems
Comments
Post a Comment