编辑代码

class Main {
	public static void main(String[] args) {
        //JSRUN引擎2.0,支持多达30种语言在线运行,全仿真在线交互输入输出。
		System.out.println("Hello world!   - java.jsrun.net ");
	}
}
package second;
import java.util.Scanner;
public class jsq {
public static void main(String[] args) {
System.out.println("请输入第1个操作数:");
Scanner s = new Scanner(System.in);
int a = s.nextInt();
System.out.println("请输入第2个操作数:");
int b = s.nextInt();
System.out.println("请输入操作符+、-、*、/:");
char f = s.next().charAt(0);
int result=0;
if (f =='+')
{  result=a+b;
System.out.println(a+"+"+b+"="+result);}
else if (f == '-')
{ result=a-b;
System.out.println(a+"-"+b+"="+result);}
else if (f == '*')
{ result=a*b;
System.out.println(a+"*"+b+"="+result);}
else if (f == '/' && b == 0)
System.out.printf("除数不能为零!");
else if (f == '/' && b != 0)
{ result=a/b;
System.out.println(a+"/"+b+"="+result);}
}
}