fork download
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4. int main()
  5. {
  6. double zahl;
  7. int exponent;
  8. double mantisse;
  9.  
  10. while (scanf("%lf", &zahl) == 1)
  11. {
  12. exponent = log10(zahl);
  13. mantisse = zahl / pow(10, exponent);
  14. printf("%f = %f * 10^%d\n", zahl, mantisse, exponent);
  15. }
  16. return 0;
  17. }
  18.  
Success #stdin #stdout 0.01s 1724KB
stdin
123.456
0.0012345
9.87654
stdout
123.456000 = 1.234560 * 10^2
0.001234 = 0.123450 * 10^-2
9.876540 = 9.876540 * 10^0