add package calculator
This commit is contained in:
1 parent
054b77ccdd
commit
062beda77e
7 files changed
+72
No files matched your search
@@ -0,0 +1,17 @@
|
||||
package calculator;
|
||||
|
||||
import java.util.Scanner;
|
||||
|
||||
public class Test {
|
||||
public static void main(String[] args) {
|
||||
try (Scanner sc = new Scanner(System.in)) {
|
||||
while (true) {
|
||||
System.out.print(">>> ");
|
||||
int a = sc.nextInt();
|
||||
char op = sc.next().charAt(0);
|
||||
int b = sc.nextInt();
|
||||
System.out.println(Factory.getCompute(op).computer(a, b));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user