fork download
  1. #include <iostream>
  2. #include <iomanip>
  3. using namespace std;
  4.  
  5. int main() {
  6. // your code goes here
  7. double pi = 3.14159265358979;
  8. cout << std::setprecision(32) << pi << endl;
  9.  
  10. char buffer3[32];
  11. sprintf(buffer3, "%.20f", pi);
  12. cout << buffer3;
  13.  
  14. return 0;
  15. }
Success #stdin #stdout 0.01s 5328KB
stdin
Standard input is empty
stdout
3.1415926535897900073734945181059
3.14159265358979000737