/*
import java.util.*;
class Main{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int arr[][] = new int[a][a];
for(int i=0;i<a;i++) {
arr[i][0] = sc.nextInt();
}
for(int i=1;i<a;i++) {
for(int f=1;f<=i;f++) {
arr[i][f] = arr[i][f-1] - arr[i-1][f-1];
}
}
for(int i=0;i<a;i++) {
for(int f=0; f<=i;f++) {
System.out.print(arr[i][f]+" ");
}
System.out.println();
}
}
}
*/
/*
import java.util.*;
class Main{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String s = sc.next();
char arr[] = s.toCharArray();
for(int i=0; i<arr.length;i++) {
if(arr[i]>='a'&&'z'>=arr[i]) {
System.out.print(arr[i]-32);
}
else if(arr[i]>='A'&&arr[i]<='Z') {
System.out.print(arr[i]+32);
}
else {
System.out.print(arr[i]);
}
}
}
}
*/
/*
import java.util.*;
class Main{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String s = sc.next();
char arr[] = s.toCharArray();
for(int i=0;i<arr.length;i++) {
if(arr[i]<='z'&&arr[i]>='a') {
System.out.print((char)(arr[i]-' '));
}
else if(arr[i]<='Z'&&arr[i]>='A') {
System.out.print((char)(arr[i]+' '));
}
else {
System.out.print(arr[i]);
}
}
}
}
*/
/*
import java.util.*;
class Main{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int arr[][] = new int [11][11];
for(int i=1;i<=9;i++) {
for(int f=1;f<=9;f++) {
arr[i][f] = sc.nextInt();
}
}
int x = sc.nextInt();
int y = sc.nextInt();
int t=0;
if(arr[x][y]==0) {
for(int i=x-1;i<=x+1;i++) {
for(int f=y-1;f<=y+1;f++) {
if(arr[i][f]==1) {
t++;
}
}
}
System.out.println(t);
}
else {
System.out.println(-1);
}
}
}
*/
/*
import java.util.*;
class Main{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String s = sc.next();
int t=0;
char arr[] = s.toCharArray();
for(int i=0;i<arr.length;i++) {
t += arr[i]-48;
}
if(t%3==0) {
System.out.println(1);
}
else {
System.out.println(0);
}
}
}
*/
/*
import java.util.*;
class Main{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String s1 = sc.next();
String s2 = sc.next();
String s3 = sc.next();
if(s1.charAt(s1.length()-1)==s2.charAt(0)&&s2.charAt(s2.length()-1)==s3.charAt(0)&&s3.charAt(s3.length()-1)==s1.charAt(0)) {
System.out.println("good");
}
else {
System.out.println("bad");
}
}
}
c 절차지향언어
java 객체지향언어 oop object oriendted programming
클래스 : 틀 ( 필드, 생성자, 메소드)
객체 : 틀로 찍어낸 물체
*/
/*
import java.util.*;
class Person{
//필드
int age;
String name;
//생성자 객체 생성시 한 번만 호출 ( 초기값설정)
Person(){
// age=1000;
// name="미정";
this(1000,"미정");
}
Person(int age){
// this.age=age;
// this.name = "미정";
this(age,"미정");
}
Person(int age, String name){
this.age=age;
this.name=name;
}
//메소드
void speak() {
System.out.println("안녕하세요 저는 "+name+"입니다.");
System.out.println("나이는 "+age+"살 입니다.");
}
}
class Main{
public static void main(String[] args) {
//Person p; //레퍼런스변수 생성 (아직 객체생성 x)
//p = new Person();
Person p = new Person();
p.age=10;
p.speak();
Person s = new Person(50);
s.speak();
Person q = new Person(100,"이태준");
q.speak();
}
}
*/
/*
import java.util.*;
class Song{
String name;
Song(String name){
this.name = name;
}
String getTitle() {
return name;
}
}
class Main{
public static void main(String[] args) {
Song mysong = new Song("Nessun Dorma");
Song yoursong = new Song("공주는 잠 못 이루고");
System.out.println("내 노래는 "+mysong.getTitle());
System.out.println("네 노래는 "+yoursong.getTitle());
}
}
*/
/*
import java.util.*;
class Phone{
static int num=0;
private St
ring name, tel;
public Phone() {
// TODO Auto-generated constructor stub
}
public Phone(String name, String tel) {
this.name = name;
this.tel = tel;
}
public static void setNum(int n) {
num=n;
//name="이름";
}
public String getName() {
num++;
return name;
}
public String getTel() {
return tel;
}
}
class Main{
public static void main(String[] args) {
Phone.num++;
System.out.println(Phone.num);
// Phone a = new Phone();
// Phone b = new Phone();
// a.num++;
// System.out.println(b.num);
//Phone.num
//int arr[] = new int[5];
//Phone arr[] = new Phone[5];
//System.out.println(arr[0].getName());
// for(int i=0;i<arr.length;i++) {
// arr[i] = new Phone("이름","tel");
// }
// Scanner sc = new Scanner(System.in);
// System.out.println("이름과 전화번호를 입력>>");
// String name1 = sc.next();
// String tel1 = sc.next();
// Phone p1 = new Phone(name1,tel1);
// System.out.println("이름과 전화번호 입력>>");
// String name2 = sc.next();
// String tel2 = sc.next();
// Phone p2 = new Phone(name2, tel2);
// System.out.println(p1.getName()+"의 번호 "+p1.getTel());
// System.out.println(p2.getName()+"의 번호 "+p2.getTel());
}
}
*/
/*
import java.util.*;
class Circle {
private int radius;
public Circle(int radius) {
this.radius = radius;
}
public int getRadius() {
return this.radius;
}
public void setRadius(int radius) {
this.radius = radius;
}
}
class CircleManager{
public static void copy(Circle src, Circle dest) {
dest.setRadius(src.getRadius());
}
public static boolean equals(Circle a, Circle b) {
if(a.getRadius()==b.getRadius()) {
return true;
}
else {
return false;
}
}
}
public class Main{
public static void main(String[] args) {
Circle pizza = new Circle(5);
Circle waffle = new Circle(1);
boolean res = CircleManager.equals(pizza, waffle);
if(res==true) {
System.out.println("pizza와 waffle 크기 같음");
}
else {
System.out.println("pizza와 waffle 크기 다름");
}
CircleManager.copy(pizza, waffle);
res = CircleManager.equals(pizza, waffle);
if(res==true) {
System.out.println("pizza와 waffle 크기 같음");
}
else {
System.out.println("pizza와 waffle 크기 다름");
}
}
}
*/
/*
import java.util.*;
class Box{
private int width, height;
private char filchar;
public Box() {
this(10,1);
}
public Box(int width, int height) {
this.height = height;
this.width = width;
}
public void draw() {
for(int i=0;i<height;i++) {
for(int f=0;f<width;f++) {
System.out.print(filchar);
}
System.out.println();
}
}
public void fill(char c) {
this.filchar = c;
}
}
class Main{
public static void main(String[] args) {
Box a = new Box();
Box b = new Box(20,3);
a.fill('*');
b.fill('%');
a.draw();
b.draw();
}
}*/
/*
import java.util.*;
class Person{
//필드
private int age;
private String name;
//생성자 객체 생성시 한 번만 호출 ( 초기값설정)
Person(){
this(1000,"미정");
}
Person(int age, String name){
this.age=age;
this.name=name;
}
//메소드
void speak() {
System.out.println("안녕하세요 저는 "+name+"입니다.");
System.out.println("나이는 "+age+"살 입니다.");
}
}
class Student extends Person{
String school;
Student(int age, String name, String sch){
super(age,name);
this.school = sch;
}
void speak() {
System.out.println("저는 학생입니다.");
}
void speak(int n) {
System.out.println("nnn");
}
}
class Teacher extends Person{
String sub;
}
class Main{
public static void main(String[] args) {
Student s = new Student(10,"fff","jjj");
s.speak(4);
}
}
*/
import java.util.*;
/*
abstract class Circle {
private int radius;
public Circle(int radius) {
this.radius = radius;
}
public int getRadius() {
return radius;
}
abstract void show();
}
*/
interface Circle{
abstract void show();
// default void view() {
// System.out.println();
// }
}
interface Circle2{
}
abstract class NamedCircle implements Circle,Circle2{
//extends Circle{
private String name;
NamedCircle(int r, String name){
super(r);
this.name = name;
}
// void show() {
// System.out.println(name+", "+"반지름 = "+getRadius());
// }
}
class Main{
public static void main(String[] args) {
NamedCircle w = new NamedCircle(5,"waffle");
w.show();
}
}