summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--4/3.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/4/3.c b/4/3.c
index d5810a9..83a45a9 100644
--- a/4/3.c
+++ b/4/3.c
@@ -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)