import java.util.*;
public class JPA209 {
static Scanner keyboard = new Scanner(System.in);
public static void main(String[] args) {
test();
test();
test();
test();
}
public static void test() {
double x,y;
System.out.print("請輸入X座標 : ");
x=keyboard.nextDouble();
System.out.print("請輸入y座標 : ");
y=keyboard.nextDouble();
if(x>0&&y>0){
System.out.println("("+x+","+y+")在第一象限");
}
else if(y==0&&x!=0){
System.out.println("("+x+","+y+")在x軸上");
}
else if(x>0&&y<0){
System.out.println("("+x+","+y+")在第四象限");
}
else if(x<0&&y>0){
System.out.println("("+x+","+y+")在第二象限");
}
else if(x==0&&y!=0){
System.out.println("("+x+","+y+")在y軸上");
}
else if(x<0&&y<0){
System.out.println("("+x+","+y+")在第三象限");
}
else{
System.out.println("("+x+","+y+")在原點");
}
}
}
209 象限座標
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言