/* gcvt.c (emx+gcc) */

/* Regression test for gcvt() */

#include <stdio.h>
#include <stdlib.h>
#include <math.h>

#if defined (__IBMC__)
#define gcvt _gcvt
#endif

int main (int argc, char *argv[])
{
  double x;
  int n;
  char in[512], out[512];

  while (fgets (in, sizeof (in), stdin) != NULL)
    {
      if (sscanf (in, "%lf %d", &x, &n) != 2)
        fprintf (stderr, "Bad input line: %s\n", in);
      else
        printf ("%s\n", gcvt (x, n, out));
    }
  return 0;
}
