/*
import java.util.*;
abstract class GameObject {
protected int distance;
protected int x, y;
public GameObject(int startX, int startY, int distance) {
this.x = startX;
this.y = startY;
this.distance = distance;
}
public int getX() { return x; }
public int getY() { return y; }
public boolean collide(GameObject p) {
if(this.x == p.getX() && this.y == p.getY())
return true;
else
return false;
}
protected abstract void move();
protected abstract char getShape();
}
class Bear extends GameObject {
char icon;
Scanner scan = new Scanner(System.in);
public Bear(int startX, int startY, int distance, char c) {
super(startX, startY, distance);
this.icon = c;
}
@Override
public void move() {
System.out.print("왼쪽(a), 아래(s), 위(d), 오른쪽(f) >> ");
String dir = scan.next();
if(dir.equals("a") && super.x > 0) {
super.x -= 1;
}
else if(dir.equals("s") && super.y < 9) {
super.y += 1;
}
else if(dir.equals("d") && super.y > 0) {
super.y -= 1;
}
else if(dir.equals("f") && super.x < 19) {
super.x += 1;
}
}
@Override
public char getShape() {
return this.icon;
}
}
class Fish extends GameObject {
char icon;
Scanner scan = new Scanner(System.in);
public Fish(int startX, int startY, int distance, char c) {
super(startX, startY, distance);
this.icon = c;
}
@Override
protected void move() {
Random r = new Random();
int turn = 0, movetime = 0;
turn++;
if(turn > 5) {
turn = 0;
movetime = 0;
}
if(movetime >= 2 && r.nextInt(2) == 0) {
int k = r.nextInt(4);
if(k == 0 && super.x > 0) {
super.x -= 1;
}
else if(k == 1 && super.y < 9) {
super.y += 1;
}
else if(k == 2 && super.y > 0) {
super.y -= 1;
}
else if(k == 3 && super.x < 19) {
super.x += 1;
}
}
}
@Override
protected char getShape() {
return icon;
}
}
public class Main {
public static void main(String[] args) {
Random xy = new Random();
char map[][] = new char[10][20];
char n;
Scanner scan = new Scanner(System.in);
System.out.println("** Bear의 Fish 먹기 게임을 시작합니다. **");
System.out.print("Bear의 아이콘을 입력해 주세요 >> ");
n = scan.next().charAt(0);
Bear 곰 = new Bear(xy.nextInt(20),xy.nextInt(10),xy.nextInt(xy.nextInt(10)),n);
System.out.print("Fish의 아이콘을 입력해 주세요 >> ");
n = scan.next().charAt(0);
Fish 물고기 = new Fish(xy.nextInt(20),xy.nextInt(10),xy.nextInt(xy.nextInt(10)),n);
for(int i = 0; i < 10; i++) {
for(int j = 0; j < 20; j++) {
if(i == 곰.getY() && j == 곰.getX()) {
map[i][j] = 곰.getShape();
}
if(i == 물고기.getY() && j == 물고기.getX()) {
map[i][j] = 물고기.getShape();
}
else {
map[i][j] = '-';
}
}
}
System.out.println();
while(곰.collide(물고기) == false && 물고기.collide(곰) == false) {
for(int i = 0; i < 10; i++) {
for(int j = 0; j < 20; j++) {
System.out.print(map[i][j]);
}System.out.println();
}
n = scan.next().charAt(0);
map[곰.getY()][곰.getY()] = '-';
곰.move();
map[곰.getY()][곰.getY()] = 곰.getShape();
map[물고기.getY()][물고기.getY()] = '-';
물고기.move();
map[물고기.getY()][물고기.getY()] = 물고기.getShape();
}
}
}
*/
/*
import java.util.*;
class Exceution {
Vector<Integer> VecObj = new Vector<Integer>();
public void add(int n) {
VecObj.add(n);
show();
}
public void show() {
int Aver = 0;
for(int i = 0; i < VecObj.size(); i++) {
Aver += VecObj.get(i);
System.out.print(VecObj.get(i) + " ");
}System.out.println();
System.out.println("현재 평균 " + Aver/VecObj.size());
}
}
public class Main {
public static void main(String[] args) {
Exceution st = new Exceution();
int n;
Scanner scan = new Scanner(System.in);
while(true) {
System.out.print("강수량 입력 (0 입력시 종료)>> ");
n = scan.nextInt();
if(n == 0) {
st.VecObj.clear();
return ;
}
else {
st.add(n);
}
}
}
}
*/
/*
import java.util.*;
class Student {
String Name, Department, SdtId, GrdPintAver;
Student (String n, String d, String s, String g) {
this.Name = n;
this.Department = d;
this.SdtId = s;
this.GrdPintAver = g;
}
public void show() {
System.out.println("----------------------------");
System.out.println("이름:" + Name);
System.out.println("학과:" + Department);
System.out.println("학번:" + SdtId);
System.out.println("학점평균:" + GrdPintAver);
}
public void check(String test) {
if(test.equals(Name)) {
System.out.println(Name + ", " + Department + ", " + SdtId + ", " + GrdPintAver);
}
}
}
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
ArrayList<Student> Sdt = new ArrayList<Student>();
System.out.println("학생 이름,학과,학번,학점평균 입력하세요.");
for(int i = 0; i < 4; i++) {
System.out.print(">> ");
String []str = scan.nextLine().split(", ");
Sdt.add(new Student(str[0], str[1], str[2], str[3]));
}
for(int i = 0; i < Sdt.size(); i++) {
Sdt.get(i).show();
}
System.out.println("----------------------------");
while(true) {
String name = new String();
System.out.print("학생 이름 >> ");
name = scan.next();
if(name.equals("그만")) {
return ;
}
else {
for(int i = 0; i < Sdt.size(); i++) {
Sdt.get(i).check(name);
}
}
}
}
}
*/
/*
import java.util.*;
abstract class Shape {
public abstract String draw();
}
class Line extends Shape {
@Override
public String draw() {
return "Line";
}
}
class Rect extends Shape {
@Override
public String draw() {
return "Rect";
}
}
class Circle extends Shape {
@Override
public String draw() {
return "Circle";
}
}
public class Main {
public static void main(String[] args) {
System.out.println("그래픽 에디터 beauty을 실행합니다.");
Vector<Shape> K = new Vector<Shape>();
Scanner scan = new Scanner(System.in);
while(true) {
int n;
System.out.print("삽입(1), 삭제(2), 모두 보기(3), 종료(4)>>");
n = scan.nextInt();
if(n == 1) {
System.out.print("Line(1), Rect(2), Circle(3)>>");
n = scan.nextInt();
if(n == 1)
K.add(new Line());
else if(n == 2)
K.add(new Rect());
else if(n == 3)
K.add(new Circle());
n = 0;
}
else if(n == 2) {
System.out.print("삭제할 도형의 위치>>");
n = scan.nextInt();
if(K.size() < n)
System.out.println("삭제할 수 없습니다.");
else
K.remove(n-1);
}
else if(n == 3) {
for(int i = 0; i < K.size(); i++) {
System.out.println(K.get(i).draw());
}
}
else {
System.out.print("beauty을 종료합니다.");
return ;
}
}
}
}
*/
import java.util.*;
class log {
String command, object;
int num;
public log(String cmd, String obj, int n) {
this.command = cmd;
this.object = obj;
this.num = n;
}
}
class Object {
String name;
int value;
public Object(String n, int v) {
this.name = n;
this.value = v;
}
public void Execution(String cmd,int num) {
if(cmd.equals("mov")) {
this.value = num;
}
else if(cmd.equals("add")) {
this.value += num;
}
else if(cmd.equals("sub")) {
this.value -= num;
}
else if()
}
}
public class Main {
public static void main(String[] args) {
Vector<log>Console = new Vector<log>();
Vector<Object>obj = new Vector<Object>();
}
}