diff options
| -rw-r--r-- | 4/3.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -98,7 +98,7 @@ int getop(char s[]) { ; s[1] = 0; - if (!isdigit(c) && c != '.') + if (!isdigit(c) && c != '.' && c != '-') return c; i = 0; @@ -108,6 +108,9 @@ int getop(char s[]) { if (c == '.') while (isdigit(s[++i] = c = getch())) ; + if (c == '-') + while (isdigit(s[++i] = c = getch())) + ; s[i] = 0; if (c != EOF) |
