/*import java.util.Scanner;
import java.util.*;
abstract class Shape {
private Shape next;
public Shape() { next = null; }
public void setNext(Shape obj) { next = obj; }
public Shape getNext() { return next; }
public abstract void draw();
}
class Line extends Shape{
@Override
public void draw() {
System.out.println("Line");
}
}
class Rect extends Shape{
@Override
public void draw() {
System.out.println("Rect");
}
}
class Circle extends Shape{
@Override
public void draw() {
System.out.println("Circle");
}
}
public class Main{
Scanner sc =new Scanner(System.in);
static boolean flag= true;
Shape st,ob;
int k;
public void input() {
System.out.print("Line(1), Rect(2), Circle(3) >> ");
k=sc.nextInt();
Shape next;
if(k==1) {next = new Line();}
else if(k==2) {next = new Rect();}
else {next = new Circle();}
if(st==null) {
st=next;
ob=next;
return ;
}
while(ob.getNext()!=null) {
ob=ob.getNext();
}
ob.setNext(next);
}
public void delete() {
System.out.print("삭제할 도형의 위치 >> ");
k=sc.nextInt();
for(int i=1;i<=k; i++) {
if(i==k) {
if(ob.getNext()==null) {System.out.println("삭제할 수 없습니다.");}
else {ob.setNext(null);}
}
}
}
public void view() {
Shape v = st;
while(v.getNext()!=null) {
v.draw();
v=v.getNext();
}
}
public void finish() {
flag= false;
System.out.println("beauty을 종료합니다.");
System.exit(0);
}
public static void main(String[] args) {
Main m= new Main();
Scanner sc =new Scanner(System.in);
String k;
System.out.println("그래픽 에디터 beauty을 실행합니다.");
while(flag==true) {
System.out.print("삽입(1), 삭제(2), 모두 보기(3), 종료(4) >> ");
k=sc.next();
if(k.equals("1")) {
m.input();
}
else if(k.equals("2")) {
m.delete();
}
else if(k.equals("3")) {
m.view();
}
else {
m.finish();
}
}
}
}
*/
/*
import java.util.*;
class Point{
int x, y;
public String toString() {
String str = x + "," +y+"의 점 입니다.";
return str;
}
public boolean equals(Object ob) { //객체를 비교할때 어떤 필드?가 같으면 객체가 같은건지 판단하고싶을때
Point o = (Point)ob;
if(x==o.x && y==o.y) return true;
else return false;
}
}
class Main{
public static void main(String[] args) {
Point p = new Point();
Point q = new Point();
q.x=10;q.y=20;
p.x=10;p.y=20;
System.out.println(Integer.toHexString(p.hashCode()));
System.out.println(p.toString());
System.out.println("equals : " + p.equals(q));
System.out.println("== : "+ (p==q));
Scanner sc =new Scanner(System.in);
String s = "hello";
String t = sc.next();
System.out.println("equals : " + s.equals(t)) System.out.println("== : "+ (s==t));
int a = 100;
String sa = Integer.toString(a); //정수 a 를 문자열 sa로 변환
System.out.println(sa+3);
int b = Integer.valueOf(sa);//문자열 sa를 정수 b로 변환
System.out.println(b+3);
double c = Double.parseDouble("3.14"); //문자열 "3.14"를 실수 3.14로 변환
System.out.println(c+0.1);
String str1;
String str = " he llo mel loj ell o ";
str1 = str.replace('l', '1');
str = str.trim();
String[] sarr = str.split(" ");
for(int i=0;i<sarr.length;i++) {
System.out.println("sarr["+i+"] : "+ sarr[i]);
double p;
p = Math.abs(-3.14);
p = Math.random()*100;
System.out.println((int)p);
p = Math.min(3.14, 2.0);
System.out.println(p);
}
}
*/
import java.util.*;
public class Main{
static boolean flag= true;
static int kc=0,cs=0;
public void S() {
if(kc==1) cs=1;
else if(kc==2) cs=3;
else cs=2;
checkSuccess();
}
public void R() {
if(kc==1) cs=2;
else if(kc==2) cs=1;
else cs=3;
checkSuccess();
}
public void P() {
if(kc==1) cs=3;
else if(kc==2) cs=2;
else cs=1;
checkSuccess();
}
public void finish() {
flag=false;
System.exit(0);
}
public void checkSuccess() {
if(cs==1) System.out.println("비겼습니다.");
else if(cs==2) System.out.println("철수가 이겼습니다.");
else System.out.println("컴퓨터가 이겼습니다.");
}
public static void main(String[] args) {
Scanner sc= new Scanner(System.in);
Main m= new Main();
int k;
String w;
while(flag==true) {
System.out.print("철수[가위(1), 바위(2), 보(3), 끝내기(4)] >> ");
k=sc.nextInt();
kc= (int)(Math.random()*3)+1;
if(kc==1) {
w="가위";
}
else if(kc==2)
{
w="바위";
}
else
{
w="보";
}
if(k==1) {
System.out.println("철수(가위) : 컴퓨터("+w+")");
m.S();
}
else if(k==2) {
System.out.println("철수(바위) : 컴퓨터("+w+")");
m.R();
}
else if(k==3) {
System.out.println("철수(보) : 컴퓨터("+w+")");
m.P();
}
else {
m.finish();
}
}
}
}