- import java.util.*;
- public class Ch01{
- public static void main(String[] args) {
- Scanner s=new Scanner(System.in);
- Double n,m;
- String a=" ",b=" ";
- a=s.next();
- b=s.next();
- try{
- n=Double.parseDouble(a);
- }
- catch(Exception e) {
- System.out.println("error");
- return;
- }
- try{
- m=Double.parseDouble(b);
- }
- catch(Exception e) {
- System.out.println("error");
- return;
- }
- if(n==0 && m==0){
- System.out.println("("+a+","+b+")"+"origin");
- }else if(n!=0 && m==0){
- System.out.println("("+a+","+b+")"+"x");
- }else if(n==0 && m!=0){
- System.out.println("("+a+","+b+")"+"y");
- }else if(n>0 && m>0){
- System.out.println("("+a+","+b+")"+"1");
- }else if(n<0 && m>0){
- System.out.println("("+a+","+b+")"+"2");
- }else if(n<0 && m<0){
- System.out.println("("+a+","+b+")"+"3");
- }else if(n>0 && m<0){
- System.out.println("("+a+","+b+")"+"4");
- }
- }
- }
複製代碼 |