fork(2) download
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. double x;
  6. while(scanf("%lf",&x)==1)
  7. {
  8. char buff[32];
  9. sprintf(buff,"%.1le",x);
  10. char *ptr=strchr(buff,'e')+2,*end=ptr;
  11. while(*end=='0') ++end;
  12. strcpy(ptr,end-(!*end));
  13. printf("%s\n",buff);
  14. }
  15. return 0;
  16. }
Success #stdin #stdout 0s 2296KB
stdin
Standard input is empty
stdout
Standard output is empty