Java程序没有提示错误,但无法运行。出现对话框error。
packagewhoami;importjava.util.Scanner;publicclassJava1{publicstaticvoidmain(String[]a...
package whoami;import java.util.Scanner;public class Java1 { public static void main(String[] args) { // TODO Auto-generated method stub int num1,num2; Scanner sc = new Scanner(System.in); num1 = sc.nextInt(); num2 = sc.nextInt(); int jia,jian,cheng,chu,yushu; jia = num1 + num2; cheng =num1 * num2; if (num1 > num2) { jian = num1 - num2; chu = num1 / num2; yushu = num1 % num2;} else { jian = num2 - num1; chu = num2 / num1; yushu = num2 % num1;} System.out.println("相加得:"+jia); System.out.println("相减得:"+jian); System.out.println("相乘得:"+cheng); System.out.println("相除得:"+chu); System.out.println("余数"+yushu); sc.close(); }}
没有提示错误
希望得到解答,谢谢! 展开
没有提示错误
希望得到解答,谢谢! 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询