summaryrefslogtreecommitdiffstats
path: root/4
diff options
context:
space:
mode:
Diffstat (limited to '4')
-rw-r--r--4/10.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/4/10.c b/4/10.c
index f4946ce..6297ee1 100644
--- a/4/10.c
+++ b/4/10.c
@@ -34,7 +34,8 @@ int getop(char[]);
- press enter to print the value at the top of the stack.
*/
int main(int argc, char *argv[]) {
- int type, op1, op2;
+ int type;
+ double op1, op2;
char s[MAXOP];
while (mgetline()) {
@@ -153,9 +154,8 @@ int getop(char s[]) {
i = 0;
- if (isdigit(c) || c == '-' || (c == '.' && isdigit(line[idx + 1]))) {
- while (isdigit((s[++i] = c = line[idx++])) ||
- (c == '.' && isdigit(line[idx + 1])))
+ if (isdigit(c) || c == '-' || c == '.') {
+ while (isdigit((s[++i] = c = line[idx++])) || c == '.')
;
idx--;
rc = NUM;