Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita95b4ac

Browse files
committed
Update BasicCalculator.java
1 parent7c9abed commita95b4ac

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎Stack/BasicCalculator.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
2-
Given an expression string, return the final result of this expression. The expression contains only integer, +, -, *, /, (, ).
3-
Example: For the expression "2*6-(23+7)/(1+2)", return 2
2+
Given an expression string, return the final result of this expression. The expression contains only integer,spaces,+, -, *, /, (, ).
3+
Example: For the expression "2 * 6 -(23 + 7) / (1 +2)", return 2
44
*/
55

66
publicclassBasicCalculator {
@@ -76,7 +76,7 @@ private int compute(int a, int b, char operator) {
7676
publicstaticvoidmain(String[]args) {
7777
BasicCalculatorq =newBasicCalculator();
7878

79-
Strings ="2*6-(23+7)/(1+2)";
79+
Strings ="2 *6-(23 + 7) / (1 +2)";
8080

8181
intres =q.calculate(s);
8282
System.out.println(res);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp