import java.util.Scanner;
public class xy1 {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.print("输入你要计算的公式个数:");
int n = in.nextInt();
for(int i = 0;i < n;i++){
System.out.print("输入:");
String str = in.next();
if(str.contains("+")){
String s[] = str.split("[+]");
int a = Integer.parseInt(s[0]);
int b = Integer.parseInt(s[1]);
int sum = a + b;
System.out.println("输出:"+ sum);
}else if(str.contains("-")){
String s[] = str.split("[-]");
int a = Integer.parseInt(s[0]);
int b = Integer.parseInt(s[1]);
int sum = a - b;
System.out.println("输出:"+ sum);
}else if(str.contains("*")){
String s[] = str.split("[*]");
int a = Integer.parseInt(s[0]);
int b = Integer.parseInt(s[1]);
int sum = a * b;
System.out.println("输出:"+ sum);
}else{
String s[] = str.split("[/]");
int a = Integer.parseInt(s[0]);
int b = Integer.parseInt(s[1]);
int sum = a / b;
System.out.println("输出:"+ sum);
}
}
}
public class xy1 {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.print("输入你要计算的公式个数:");
int n = in.nextInt();
for(int i = 0;i < n;i++){
System.out.print("输入:");
String str = in.next();
if(str.contains("+")){
String s[] = str.split("[+]");
int a = Integer.parseInt(s[0]);
int b = Integer.parseInt(s[1]);
int sum = a + b;
System.out.println("输出:"+ sum);
}else if(str.contains("-")){
String s[] = str.split("[-]");
int a = Integer.parseInt(s[0]);
int b = Integer.parseInt(s[1]);
int sum = a - b;
System.out.println("输出:"+ sum);
}else if(str.contains("*")){
String s[] = str.split("[*]");
int a = Integer.parseInt(s[0]);
int b = Integer.parseInt(s[1]);
int sum = a * b;
System.out.println("输出:"+ sum);
}else{
String s[] = str.split("[/]");
int a = Integer.parseInt(s[0]);
int b = Integer.parseInt(s[1]);
int sum = a / b;
System.out.println("输出:"+ sum);
}
}
}
}