fork download
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4.  
  5. int main() {
  6. double a, b, f, d;
  7. cin >> d;
  8. f = (sqrt(5) + 1) / 2;
  9. b = d / sqrt (1 + f * f);
  10. a = b * f;
  11. cout << a << ' ' << b;
  12. return 0;
  13. }
Success #stdin #stdout 0s 3472KB
stdin
Standard input is empty
stdout
5.88117e+103 3.63476e+103