日期:2014-05-20 浏览次数:20732 次
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轴上"); } } }