江苏省高校计算机等级考试命题研究院 江苏省高校计算机等级考试辅导
2014春江苏省二级C上机真题第1套

源代码如下:

#include <stdio.h>
#include <conio.h>
double tail(double x, int n)          
{   int m;
    while(x>=1)
      {  m++;   x=x/10;  }
    while(x<0.1)
      {  m--;    x=x*10;  }
  *n=m;
  return x;
}
int main()
{  double x,m;
int n, x_sign=1;
   do
   {  printf("please input the x:");
      scanf("%lf,&x");
   }while(0=x);
   if(x<0)
   {  x_sign=-1;      x=-x;}
   m=tail(x, &n);
   m=x_sign*m;
   printf("%lfe%d", m,n);
   getch();
   return 0;
}