You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
455 B
18 lines
455 B
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();
|
|
|
|
|
|
}
|