Skip to content

Commit 554ebfa

Browse files
committed
small formatting improvement coders-school#2
1 parent bc5bda0 commit 554ebfa

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

homework/calculate/calculate.hpp

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,19 @@
22
#include <string>
33

44
std::string calculate(const std::string& command, int first, int second) {
5-
if (command=="add") {
5+
if (command == "add") {
66
return std::to_string(first + second);
7-
} else if (command=="subtract") {
8-
return std::to_string(first - second);
9-
} else if (command=="multiply") {
7+
} else if (command == "subtract") {
8+
return std::to_string(first - second);
9+
} else if (command == "multiply") {
1010
return std::to_string(first * second);
11-
} else if (command=="divide") {
11+
} else if (command == "divide") {
1212
if (second == 0) {
1313
return "Division by 0";
1414
} else {
1515
return std::to_string(first / second);
1616
}
17-
} else {
17+
} else {
1818
return "Invalid data";
19-
}
20-
19+
}
2120
}

0 commit comments

Comments
 (0)