From 8f900a76d3e78cc01f2a6e9f237ce57da468a078 Mon Sep 17 00:00:00 2001 From: Sadeep Madurange Date: Sun, 12 Dec 2021 12:50:26 +0800 Subject: 4.7 --- 4/7.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/4/7.c b/4/7.c index 9ddc2bb..c19baa1 100644 --- a/4/7.c +++ b/4/7.c @@ -187,7 +187,6 @@ int getop(char s[]) { return c; i = 0; - // numbers if (isdigit(c) || c == '-') { // minus operator @@ -196,7 +195,6 @@ int getop(char s[]) { s[i] = 0; return '-'; } - while (isdigit(s[++i] = c = getch()) || c == '.') ; rv = NUMBER; @@ -205,9 +203,7 @@ int getop(char s[]) { int count; for (count = 0; isalnum(s[++i] = c = getch()); count++) ; - int islout = strncmp("lout", s, 4 * sizeof(char)) == 0; - if (count == 0 || islout) { if (islout) rv = VARIABLE; @@ -218,7 +214,7 @@ int getop(char s[]) { if (c != '\n') { ungetch(c); ungetch(nc); - } + } rv = VARIABLE; } } else { @@ -227,7 +223,6 @@ int getop(char s[]) { } s[i] = 0; - if (c != EOF) ungetch(c); -- cgit v1.2.3