diff --git a/calculator.java b/calculator.java new file mode 100644 index 0000000..6224d86 --- /dev/null +++ b/calculator.java @@ -0,0 +1,17 @@ +import java.util.Scanner; + +public class calculator { + public static void main(String[] args) { + Scanner scanner = new Scanner(System.in); + + System.out.print("请输入第一个数:"); + double num1 = scanner.nextDouble(); + + System.out.print("请输入第二个数:"); + double num2 = scanner.nextDouble(); + + System.out.print("请选择操作符 (+, -, *, /, %):"); + String operation = scanner.next(); + + +}