java在cmd中运行提示找不到或无法加载主类 5
packageyewan;importjava.util.Scanner;publicclassTest{publicstaticvoidmian(String[]arg...
package yewan;
import java.util.Scanner;
public class Test {
public static void mian (String[] args) {
Scanner a=new Scanner(System.in);
System.out.println("输入第一个数字");
double A=a.nextDouble();
Scanner b=new Scanner(System.in);
System.out.println("输入第二个数字");
double B=b.nextDouble();
Scanner c=new Scanner(System.in);
System.out.println("输入数字");
double C=c.nextDouble();
double AA=A+B;
double BB=A-B;
double CC=A*B;
double DD=A/B;
if(C==1) {
System.out.println(AA);
}else if(C==2) {
System.out.println(BB);
}else if(C==3) {
System.out.println(CC);
}else if(C==4) {
System.out.println(DD);
}
}
} 展开
import java.util.Scanner;
public class Test {
public static void mian (String[] args) {
Scanner a=new Scanner(System.in);
System.out.println("输入第一个数字");
double A=a.nextDouble();
Scanner b=new Scanner(System.in);
System.out.println("输入第二个数字");
double B=b.nextDouble();
Scanner c=new Scanner(System.in);
System.out.println("输入数字");
double C=c.nextDouble();
double AA=A+B;
double BB=A-B;
double CC=A*B;
double DD=A/B;
if(C==1) {
System.out.println(AA);
}else if(C==2) {
System.out.println(BB);
}else if(C==3) {
System.out.println(CC);
}else if(C==4) {
System.out.println(DD);
}
}
} 展开
2个回答
2017-11-13
展开全部
mkdir yewan
REM Test.java放到yewan子目录里面
javac yewan\Test.java
java yewan.Test
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
REM Test.java放到yewan子目录里面
javac yewan\Test.java
java yewan.Test
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询