#include #include /* get the next operator or operand */ int getop(char s[]) { int i, c; while ((s[0] = c = getc(stdin)) == ' ' || c == '\t') /* no-op */ ; s[1] = '\0'; if ( !isdigit(c) && c != '.') return c; /* not a number */ i = 0; if ( isdigit(c) ) /* collect the integer part */ while (isdigit(s[++i] = c = getc(stdin))) ; if (c == '.') /* collect the fraction part */ while (isdigit(s[++i] = c = getc(stdin))) ; s[i] = '\0'; if (c != EOF) ungetc(c, stdin); return '0'; }