计算器加减乘除取余等的实现

main
lh0923 1 month ago
parent 691294449b
commit fb0fa3b493

@ -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();
}
Loading…
Cancel
Save