fork download
  1. #include <iostream>
  2. #include <sstream>
  3. #include <string>
  4.  
  5. using namespace std;
  6.  
  7. int main() {
  8. ostringstream ss;
  9. ss << scientific << 123456789.87654321;
  10. string s = ss.str();
  11. s.replace(s.find("e"), 1, "*10^");
  12. cout << s << endl;
  13. return 0;
  14. }
Success #stdin #stdout 0.01s 2816KB
stdin
Standard input is empty
stdout
1.234568*10^+08