8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e5a5be8 commit fd9eb89Copy full SHA for fd9eb89
projects/05/calculator.cpp
@@ -74,6 +74,7 @@ Token Token_stream::get()
74
case '5':
75
case '6':
76
case '7':
77
+ case '8':
78
case '9':
79
{
80
cin.putback(ch); // put digit back into the input stream
@@ -127,6 +128,7 @@ double term ()
127
128
case '*':
129
left *= primary();
130
t = ts.get();
131
+ break;
132
133
case '/':
134
@@ -161,7 +163,7 @@ double expression ()
161
163
break;
162
164
165
case '-':
- left += term(); // evaluate Term and subtract
166
+ left -= term(); // evaluate Term and subtract
167
168
169
0 commit comments