//
//public class Main {
//
// public static void main(String[] args) {
// System.out.println("hi");
//
// }
//
//}
/*
import java.util.*;
interface Stack
{
int length();
int capacity();
String pop();
boolean push(String val);
}
class StringStack implements Stack
{
int top=-1;
int full,cp;
String Stack[] = new String[200];
StringStack(int n)
{
cp=n;
full=n;
}//생성자
public int length() {
return full-cp;
}
public int capacity() {
return cp;
}
public String pop() {
cp++;
return Stack[top--];
}
public boolean push(String val) {
if(cp==0) return false;
cp--;
Stack[++top]=val;
return true;
}
}
public class Main
{
public static void main(String[] args) {
Scanner t = new Scanner(System.in);
System.out.print("총 스택 저장 공간의 크기 입력>> ");
int n = t.nextInt();
StringStack ss = new StringStack(n);
System.out.print("문자열 입력>> ");
String name=t.next();
while(!name.equals("그만"))
{
if(ss.push(name)==false)
System.out.println("스택이 꽉 차서 푸시 불가!");
System.out.println("현재 저장된 개수: "+ss.length());
System.out.println("저장 가능한 개수 : "+ss.capacity());
System.out.print("문자열 입력>> ");
name=t.next();
}
System.out.print("저장된 모든 문자열: ");
while(ss.top!=-1)
{
System.out.print(ss.pop()+" ");
}
}
}
*/
/*
import java.util.*;
abstract class humanInfor {
double height, weight;
double getHeight() {
return height;
}
double getWeight() {
return weight;
}
abstract void setHeight();
abstract void setWeight();
}
class human extends humanInfor {
public void setHeight() {
height = (double)(Math.random()*40+150);
}
void setWeight() {
weight = (double)(Math.random()*40+60);
}
}
class abcHighClassroom {
human[] h; //학생 객체배열
int n; //학생수
int gh=0, gw=0;
abcHighClassroom(int n) {
this.n=n;
h = new human[n];
for(int i=0; i<n; i++)
{
h[i] = new human();
h[i].setHeight();
h[i].setWeight();
}
}
public void max(int k, int p)
{
arrange(k);
view(k, p);
}
void arrange(int k)
{
human temp;
if(k==1)
{
if(gh==0)
{
for(int i=1; i<n; i++)
{
for(int j=0; j<n-i; j++)
{
if(h[j].getHeight()<h[j+1].getHeight())
{
temp = h[j];
h[j] = h[j+1];
h[j+1] = temp;
}
}
}
gh=1;
}
}
else
{
if(gw==0)
{
for(int i=1; i<n; i++)
{
for(int j=0; j<n-i; j++)
{
if(h[j].getWeight()<h[j+1].getWeight())
{
temp = h[j];
h[j] = h[j+1];
h[j+1] = temp;
}
}
}
gw=1;
}
}
}
void view(int k,int p)
{
if(k==1)
for(int i=0; i<p; i++)
System.out.printf("%2d등 %.1f\n",i+1,h[i].getHeight());
else
for(int i=0; i<p; i++)
System.out.printf("%2d등 %.1f\n",i+1,h[i].getWeight());
}
}
public class Main {
public static void main(String[] args) {
Scanner t = new Scanner(System.in);
System.out.print("학생 몇명을 조사하겠습니까?(최대 50명)>>");
int n = t.nextInt();
abcHighClassroom ah = new abcHighClassroom(n);
int g=1;
while(g==1)
{
System.out.println("무엇을 구할라 하십니까?");
System.out.print("키(1), 몸무게(2)>>");
int k = t.nextInt();
System.out.print("최대 몇명까지 구하시겟습니까?>> ");
int p = t.nextInt();
ah.max(k, p);
System.out.println("계속 하시겠습니까?");
System.out.print("예(1), 아니요(2)>>");
g = t.nextInt();
}
System.out.println("종료 합니다");
}
}
*/
import java.util.*;
abstract class PairMap
{
protected String keyArray[];
int ktop = -1;
int vtop = -1;
protected String valueArray[];
abstract String get(String key);
abstract void put(String key, String value);
abstract String delete(String key);
abstract int length();
}
class Dictionary extends PairMap
{
Dictionary()
{
}
@Override
String get(String key) {
// TODO Auto-generated method stub
for(int i=0; i<=vtop; i++)
{
}
return null;
}
@Override
void put(String key, String value) {
// TODO Auto-generated method stub
keyArray[++ktop]=key;
valueArray[++vtop]=key;
}
@Override
String delete(String key) {
// TODO Auto-generated method stub
for(int i=0; i<=ktop; i++)
{
if(keyArray[i]==key)
{
return valueArray[i];
}
}
return null;
}
@Override
int length() {
// TODO Auto-generated method stub
return 0;
}
}
public class Main
{
public static void main(String[] args) {
String key, value;
Dictionary d = new Dictionary();
Scanner t = new Scanner(System.in);
int n = t.nextInt();
for(int i=0; i<n; i++)
{
System.out.print("key 값>>");
key = t.next();
System.out.print("value 값>>");
value = t.next();
d.put(key, value);
}
}
}