其实我是想用这个程序判断象限问题的import java.util.*;
public class xiangxian
{
public static void main(String[] args)
{
float x,y;
Scanner s1 = new Scanner(System.in);
Scanner s2 = new Scanner(System.in);
System.out.println("请输入X的值:");
x = s1.nextFloat();
System.out.println("请输入Y的值:");
y = s2.nextFloat();
if(x>0&&y>0)
{
System.out.println("第一象限");
}
if(x<0&&y>0)
{
System.out.println("第二象限");
}
if(x<0&&y<0)
{
System.out.print("第三象限");
}
if(x>0&&y<0)
{
System.out.println("第四象限");
}
if(x==0)
{
System.out.println("在Y轴上");
}
if(y==0)
{
System.out.println("在X轴上");
}
}
}出错提示是:
java.lang.NoSuchMethodError: main
Exception in thread "main"
public class xiangxian
{
public static void main(String[] args)
{
float x,y;
Scanner s1 = new Scanner(System.in);
Scanner s2 = new Scanner(System.in);
System.out.println("请输入X的值:");
x = s1.nextFloat();
System.out.println("请输入Y的值:");
y = s2.nextFloat();
if(x>0&&y>0)
{
System.out.println("第一象限");
}
if(x<0&&y>0)
{
System.out.println("第二象限");
}
if(x<0&&y<0)
{
System.out.print("第三象限");
}
if(x>0&&y<0)
{
System.out.println("第四象限");
}
if(x==0)
{
System.out.println("在Y轴上");
}
if(y==0)
{
System.out.println("在X轴上");
}
}
}出错提示是:
java.lang.NoSuchMethodError: main
Exception in thread "main"
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货