top of page

게시판 게시물

jisung0215
2023년 12월 26일
In 소스 코드 제출
////import java.util.Scanner; //// ////abstract class Converter { //// //// abstract protected double convert(double src); //// //// abstract protected String getSrcString(); //// //// abstract protected String getDestString(); //// //// protected double ratio; //// //// public void run() { //// //// Scanner scanner = new Scanner(System.in)(http://System.in); //// //// System.out.println(getSrcString() + "을" + getDestString() + "로 바꿉니다."); //// //// System.out.print(getSrcString() + "을 입력하세요>>"); //// //// double val = scanner.nextDouble(); //// //// double res = convert(val); //// //// System.out.println("변환결과: " + res + getDestString() + "입니다"); //// //// scanner.close(); //// //// } //// ////} //// ////class Km2Mile extends Converter //// ////{ //// //// public Km2Mile(double res) //// //// { //// //// this.ratio = res; //// //// } //// //// protected double convert(double src) { //// //// return src / ratio; //// //// } //// //// protected String getSrcString() { //// //// return "Km"; //// //// } //// //// protected String getDestString() { //// ////// TODO Auto-generated method stub //// //// return "mile"; //// //// } //// ////} //// ////class Main { //// //// public static void main(String[] args) { //// //// Km2Mile toMile = new Km2Mile(1.6); //// //// toMile.run((http://toMile.run)); //// //// } //// ////} ///* //class Point{ // private int x,y; // public Point(int x,int y) {this.x=x;this.y=y;} // public int getX() {return x;} // public int getY() {return y;} // protected void move(int x,int y) {this.x=x; this.y=y;} //} // //class ColorPoint extends Point //{ // String color; // public ColorPoint() // { // this(0,0); // } // public ColorPoint(int x,int y) // { // super(x,y); // color="black"; // } // public void setColor(String color) // { // this.color=color; // } // public void setXY(int x,int y) // { // move(x,y); // } // public String toString() // { // return color+"색의 ("+getX()+","+getY()+")의 점 "; // } // //} // //class Main //{ // public static void main(String[] args) { // ColorPoint zeroPoint=new ColorPoint(); // System.out.println(zeroPoint.toString()+"입니다."); // // ColorPoint cp =new ColorPoint(10,10); // cp.setXY(5,5); // cp.setColor("RED"); // System.out.println(cp.toString()+"입니다."); // } //} //*/ ///* //GUI : Graphical User Interface (그림으로 사용자와 소통) // //컨테이너 : 종이 (프레임frame,패널panel 등등 ) //컴포넌트 : 스티커 (버튼, 레이블, 텍스트필드 등등) // //swing vs awt //*/ ///* gui 기본 틀!!!! //import java.awt.*; //import javax.swing.*; // //class Main extends JFrame{ // public Main() { // //컨테이너.. 컴포넌트.. 이런거 설정 // setSize(500, 300); // 필수) 프레임 크기 설정 (가로길이,세로길이) // setVisible(true); // 필수) 프레임을 보여주겠습니다! // } // public static void main(String[] args) { // Main m = new Main(); // 메인 객체 생성 // } //} //*/ ///* //import java.awt.*; //import javax.swing.*; // //class Main extends JFrame{ // public Main() { // setTitle("지성이의 첫 GUI"); //프레임 제목 설정 // setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //창닫으면 프로그램종료 // Container c = getContentPane(); // 프레임의 이름을 c로 하겠다! // c.setBackground(Color.orange)(http://Color.orange); // 프레임c의 배경색 설정 // c.setLayout(new FlowLayout()); // 프레임c의 배치관리자 설정 // // JLabel la = new JLabel("지성아안녕!"); // 레이블? 라벨? 생성 // la.setForeground(Color.BLUE)(http://Color.BLUE); // 라벨의 글자색 파란색으로 설정 // c.add(la); // 프레임에 라벨 추가 // // // JButton b1 = new JButton("press!"); // 버튼 생성 // b1.setBackground(Color.RED)(http://Color.RED); // 배경색 설정 // b1.setForeground(Color.white);// 글자색 설정 // c.add(b1); // // JTextField tf = new JTextField("아이디를 입력하세요!"); //텍스트필드 생성 // c.add(tf); // // c.add(new JButton("exit")); // 이름이 없는 버튼을 생성하면서 프레임에 바로 추가 // // (나중에 얘를 변경하려면 쪼금 힘들어짐..) // // setSize(1000, 200); // 필수) 프레임 크기 설정 (가로길이,세로길이) // setVisible(true); // 필수) 프레임을 보여주겠습니다! // } // // public static void main(String[] args) { // Main m = new Main(); // 메인 객체 생성 // } //} //*/ //import java.awt.*; //import javax.swing.*; // //class Main extends JFrame //{ // public Main(){ // // setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); // Container c=getContentPane(); // // setSize(500,300); // setVisible(true); // } // public static void main(String[] args) { // new Main(); // } //} import java.util.*; import java.awt.*; import javax.swing.*; class Board extends JFrame{ public void print(){ //System.out.print(); } } class AaaEx extends JFrame { public AaaEx() { setTitle("ContentPane과 JFrame"); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); Container aaa = getContentPane(); aaa.setBackground(Color.WHITE); aaa.setLayout(new FlowLayout()); aaa.add(new JButton("ESC")); JButton x = new JButton(" "); x.setBackground(Color.WHITE); aaa.add(x); aaa.add(new JButton("F1")); aaa.add(new JButton("F2")); aaa.add(new JButton("F3")); aaa.add(new JButton("F4")); JButton y = new JButton(" "); y.setBackground(Color.WHITE); aaa.add(y); JButton[] btns = new JButton[4]; for (int i = 0; i < btns.length; i++) { btns[i] = new JButton("F" + (i + 5)); aaa.add(btns[i]); } // aaa.add(new JButton("F5")); // aaa.add(new JButton("F6")); // aaa.add(new JButton("F7")); // aaa.add(new JButton("F8")); JButton z = new JButton(" "); z.setBackground(Color.WHITE); aaa.add(z); aaa.add(new JButton("F9")); aaa.add(new JButton("F10")); aaa.add(new JButton("F11")); aaa.add(new JButton("F12")); JButton a = new JButton(" "); a.setBackground(Color.WHITE); aaa.add(a); aaa.add(new JButton("PrtSc")); aaa.add(new JButton("ScrLk")); aaa.add(new JButton("Pause")); aaa.add(new JButton("[Color]")); JButton b = new JButton(" "); b.setBackground(Color.WHITE); aaa.add(b); aaa.add(new JButton("`~")); aaa.add(new JButton(" 1 !")); aaa.add(new JButton(" 2 @")); aaa.add(new JButton("3 #")); aaa.add(new JButton("4 $")); aaa.add(new JButton("5 %")); aaa.add(new JButton("6 ^")); aaa.add(new JButton("7 &")); aaa.add(new JButton("8 *")); aaa.add(new JButton("9 (")); aaa.add(new JButton("0 )")); aaa.add(new JButton("- _")); aaa.add(new JButton("= +")); aaa.add(new JButton(" <~~~~~~~~~~")); JButton c = new JButton(" "); c.setBackground(Color.WHITE); aaa.add(c); aaa.add(new JButton("Ins")); aaa.add(new JButton("Home")); aaa.add(new JButton("PgUp")); JButton d = new JButton(" "); d.setBackground(Color.WHITE); aaa.add(d); aaa.add(new JButton("Num")); aaa.add(new JButton(" / ")); aaa.add(new JButton(" * ")); aaa.add(new JButton(" - ")); aaa.add(new JButton(" Tab ")); aaa.add(new JButton("Qㅂ")); aaa.add(new JButton("Wㅈ")); aaa.add(new JButton("Eㄷ")); aaa.add(new JButton("Rㄱ")); aaa.add(new JButton("Tㅅ")); aaa.add(new JButton("Yㅛ")); aaa.add(new JButton("Uㅕ")); aaa.add(new JButton("Iㅑ")); aaa.add(new JButton("Oㅐ")); aaa.add(new JButton("Pㅔ")); aaa.add(new JButton("[{")); aaa.add(new JButton("]}")); aaa.add(new JButton(" \\|W ")); JButton e = new JButton(" "); e.setBackground(Color.WHITE); aaa.add(e); aaa.add(new JButton("Del ")); aaa.add(new JButton(" End ")); aaa.add(new JButton("PrDn")); JButton g = new JButton(" "); g.setBackground(Color.WHITE); aaa.add(g); aaa.add(new JButton(" 7 ")); aaa.add(new JButton(" 8 ")); aaa.add(new JButton(" 9 ")); aaa.add(new JButton(" + ")); aaa.add(new JButton(" CapsLock ")); aaa.add(new JButton("Aㅁ")); aaa.add(new JButton("Sㄴ")); aaa.add(new JButton("Dㅇ")); aaa.add(new JButton("Fㄹ")); aaa.add(new JButton("Gㅎ")); aaa.add(new JButton("Hㅗ")); aaa.add(new JButton("Jㅓ")); aaa.add(new JButton("Kㅏ")); aaa.add(new JButton("Lㅣ")); aaa.add(new JButton(";:")); aaa.add(new JButton(" ' ")); aaa.add(new JButton(" Enter ")); JButton h = new JButton( " "); h.setBackground(Color.WHITE); aaa.add(h); aaa.add(new JButton(" 4 ")); aaa.add(new JButton(" 5 ")); aaa.add(new JButton(" 6 ")); aaa.add(new JButton(" + ")); aaa.add(new JButton(" Shift ")); aaa.add(new JButton("Zㅋ")); aaa.add(new JButton("Xㅌ")); aaa.add(new JButton("Cㅊ")); aaa.add(new JButton("Vㅍ")); aaa.add(new JButton("Nㅜ")); aaa.add(new JButton("Mㅡ")); aaa.add(new JButton(" , < ")); aaa.add(new JButton(" . > ")); aaa.add(new JButton(" / ? ")); aaa.add(new JButton(" Shift ")); JButton I = new JButton(" "); I.setBackground(Color.WHITE); aaa.add(I); aaa.add(new JButton("I")); JButton J = new JButton(" "); J.setBackground(Color.WHITE); aaa.add(J); aaa.add(new JButton(" 1 ")); aaa.add(new JButton(" 2 ")); aaa.add(new JButton(" 3 ")); aaa.add(new JButton("Enter")); aaa.add(new JButton(" Ctrl ")); aaa.add(new JButton(" [] & ")); aaa.add(new JButton(" Alt ")); aaa.add(new JButton(" ----------------- ")); aaa.add(new JButton("Alt 한/영")); aaa.add(new JButton(" Fn ")); aaa.add(new JButton(" [], ")); aaa.add(new JButton("Ctrl 한자")); JButton k = new JButton(" "); k.setBackground(Color.WHITE); aaa.add(k); aaa.add(new JButton("--")); aaa.add(new JButton("|")); aaa.add(new JButton("--")); JButton l = new JButton(" "); l.setBackground(Color.WHITE); aaa.add(l); aaa.add(new JButton(" 0 ")); aaa.add(new JButton(" . Del ")); aaa.add(new JButton("Enter")); setSize(1400, 600); setVisible(true); } } class Main { public static void main(String[] args) { new AaaEx(); } }
0
0
3
jisung0215
2023년 12월 25일
In 소스 코드 제출
import java.awt.*; import javax.swing.*; class ContenPaneEx extends JFrame { public ContenPaneEx(){ setTitle("ContentPane과 JFrame"); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); Container contentPane =getContentPane(); contentPane.setBackground(Color.O(http://Color.ORANGE)RANGE)(http://Color.ORANGE); contentPane.setLayout(new FlowLayout()); contentPane.add(new JButton("OK")); contentPane.add(new JButton("Cancel")); contentPane.add(new JButton("Ignore")); setSize(300,150); setVisible(true); } } class Main{ public static void main(String[] args) { new ContentPaneEx(); } }
1
2
16
jisung0215
2023년 12월 19일
In 소스 코드 제출
//import java.util.Scanner; // //abstract class Converter { // // abstract protected double convert(double src); // // abstract protected String getSrcString(); // // abstract protected String getDestString(); // // protected double ratio; // // public void run() { // // Scanner scanner = new Scanner(System.in)(http://System.in); // // System.out.println(getSrcString() + "을" + getDestString() + "로 바꿉니다."); // // System.out.print(getSrcString() + "을 입력하세요>>"); // // double val = scanner.nextDouble(); // // double res = convert(val); // // System.out.println("변환결과: " + res + getDestString() + "입니다"); // // scanner.close(); // // } // //} // //class Km2Mile extends Converter // //{ // // public Km2Mile(double res) // // { // // this.ratio = res; // // } // // protected double convert(double src) { // // return src / ratio; // // } // // protected String getSrcString() { // // return "Km"; // // } // // protected String getDestString() { // //// TODO Auto-generated method stub // // return "mile"; // // } // //} // //class Main { // // public static void main(String[] args) { // // Km2Mile toMile = new Km2Mile(1.6); // // toMile.run((http://toMile.run)); // // } // //} /* class Point{ private int x,y; public Point(int x,int y) {this.x=x;this.y=y;} public int getX() {return x;} public int getY() {return y;} protected void move(int x,int y) {this.x=x; this.y=y;} } class ColorPoint extends Point { String color; public ColorPoint() { this(0,0); } public ColorPoint(int x,int y) { super(x,y); color="black"; } public void setColor(String color) { this.color=color; } public void setXY(int x,int y) { move(x,y); } public String toString() { return color+"색의 ("+getX()+","+getY()+")의 점 "; } } class Main { public static void main(String[] args) { ColorPoint zeroPoint=new ColorPoint(); System.out.println(zeroPoint.toString()+"입니다."); ColorPoint cp =new ColorPoint(10,10); cp.setXY(5,5); cp.setColor("RED"); System.out.println(cp.toString()+"입니다."); } } */ /* GUI : Graphical User Interface (그림으로 사용자와 소통) 컨테이너 : 종이 (프레임frame,패널panel 등등 ) 컴포넌트 : 스티커 (버튼, 레이블, 텍스트필드 등등) swing vs awt */ /* gui 기본 틀!!!! import java.awt.*; import javax.swing.*; class Main extends JFrame{ public Main() { //컨테이너.. 컴포넌트.. 이런거 설정 setSize(500, 300); // 필수) 프레임 크기 설정 (가로길이,세로길이) setVisible(true); // 필수) 프레임을 보여주겠습니다! } public static void main(String[] args) { Main m = new Main(); // 메인 객체 생성 } } */ /* import java.awt.*; import javax.swing.*; class Main extends JFrame{ public Main() { setTitle("지성이의 첫 GUI"); //프레임 제목 설정 setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //창닫으면 프로그램종료 Container c = getContentPane(); // 프레임의 이름을 c로 하겠다! c.setBackground(Color.orange)(http://Color.orange); // 프레임c의 배경색 설정 c.setLayout(new FlowLayout()); // 프레임c의 배치관리자 설정 JLabel la = new JLabel("지성아안녕!"); // 레이블? 라벨? 생성 la.setForeground(Color.BLUE)(http://Color.BLUE); // 라벨의 글자색 파란색으로 설정 c.add(la); // 프레임에 라벨 추가 JButton b1 = new JButton("press!"); // 버튼 생성 b1.setBackground(Color.RED)(http://Color.RED); // 배경색 설정 b1.setForeground(Color.white);// 글자색 설정 c.add(b1); JTextField tf = new JTextField("아이디를 입력하세요!"); //텍스트필드 생성 c.add(tf); c.add(new JButton("exit")); // 이름이 없는 버튼을 생성하면서 프레임에 바로 추가 // (나중에 얘를 변경하려면 쪼금 힘들어짐..) setSize(1000, 200); // 필수) 프레임 크기 설정 (가로길이,세로길이) setVisible(true); // 필수) 프레임을 보여주겠습니다! } public static void main(String[] args) { Main m = new Main(); // 메인 객체 생성 } } */ import java.awt.*; import javax.swing.*; class Main extends JFrame { public Main(){ setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); Container c=getContentPane(); setSize(500,300); setVisible(true); } public static void main(String[] args) { new Main(); } }
0
0
2
jisung0215
2023년 12월 18일
In 소스 코드 제출
import java.util.Scanner; abstract class Converter{ abstract protected double convert(double src);//추상 메솓ㅡ abstract protected String getSrcString();//추상 메소드 abstract protected String getDestString();//추상 메소드 protected double ratio;//비율 public void run() { Scanner scanner=new Scanner(System.i(http://System.in)n)(http://System.in); System.out.println(getSrcString()+"을"+getDestString()+"로 바꿉니다."); System.out.print(getSrcString()+"을 입력하세요>>"); double val=scanner.nextDouble(); double res=convert(val); System.out.println("변환결과: "+res+getDestString()+"입니다"); scanner.close(); } } class Km2Mile extends Converter { public Km2Mile(double res) { this.ratio=res; } protected double convert(double src) { return src/ratio; } protected String getSrcString() { return "Km"; } protected String getDestString() { // TODO Auto-generated method stub return "mile"; } } class Main{ public static void main(String[] args) { Km2Mile toMile=new Km2Mile(1.6); toMile.(http://toMile.run)run((http://toMile.run)); } }
0
0
2
jisung0215
2023년 12월 12일
In 소스 코드 제출
/* class TV { private int size; public TV(int size) { this.size = size; } protected int getSize() { return size; } } class ColorTV extends TV { int color; public ColorTV(int size, int color) { super(size); this.color = color; } } class IPTV extends ColorTV { String iptv; public IPTV(String iptv,int size, int color) { super(size, color); this.iptv=iptv; } public void printProperty() { System.out.print("나의 IPTV는 " + iptv + "주소의 " + getSize() + "인치 " + color + "컬러"); } } class Main { public static void main(String[] args) { IPTV ipTV = new IPTV("192.1.2", 32, 2048); ipTV.printProperty(); } } class Point{ private int x,y; public Point(int x,int y) { this.x=x;this.y=y; } public int getX() {return x; } public int getY() {return y; } protected void move(int x,int y) {this.x=x;this.y=y;} } class ColorPoint extends Point { String color; public ColorPoint(int x,int y,String color) { super(x,y); this.color=color; } public void setColor(String color) { this.color=color; } public void setXY(int x,int y) { move(x,y); } public String toString() { return color+"색의 ("+getX()+","+getY()+")의 점"; } } class Main { public static void main(String[] args) { ColorPoint cp=new ColorPoint(5,5,"YELLOW"); cp.setXY(10,20); cp.setColor("RED"); String str=cp.toString(); System.out.println(str+"입니다."); } }*/ import java.util.Scanner; abstract class Converter{ abstract protected double convert(double src);//추상 메솓ㅡ abstract protected String getSrcString();//추상 메소드 abstract protected String getDestString();//추상 메소드 protected double ratio;//비율 public void run() { Scanner scanner=new Scanner(System.in)(http://System.in); System.out.println(getSrcString()+"을"+getDestString()+"로 바꿉니다."); System.out.print(getSrcString()+"을 입력하세요>>"); double val=scanner.nextDouble(); double res=convert(val); System.out.println("변환결과: "+res+getDestString()+"입니다"); scanner.close(); } } class Won2Dollar extends Converter { public Won2Dollar(double res) { this.ratio=res; } protected double convert(double src) { return src/ratio; } protected String getSrcString() { return "원"; } protected String getDestString() { // TODO Auto-generated method stub return "달러"; } } class Main{ public static void main(String[] args) { Won2Dollar toDollar=new Won2Dollar(1200); toDollar.run((http://toDollar.run)); } }
0
0
5
jisung0215
2023년 12월 11일
In 소스 코드 제출
class TV{ private int size; public TV(int size) {this.size=size;} protected int getSize() {return size;} } class ColorTV extends TV { int color; public ColorTV(int size ,int color) { super(size); this.color=color; } } class IPTV  extends ColorTV { public ColorTV(int size ,int color,int iptv) { super(size); super(color); this.iptv=iptv; } int iptv; public void printProperty() { System.out.print("나의 IPTV는 "+iptv+"주소의"+getSize()+"인치 "+color+"컬러"); } } class Main{ public static void main(String[] args) { IPTV ipTV=new IPTV("192.1.2"32,1024); ipTV.printProperty(); } }
0
0
5
jisung0215
2023년 12월 05일
In 소스 코드 제출
/* class SharpPencil { private int width; private int amount; public int getAmount() { return amount; } public void setAmount(int amount) { this.amount = amount; } } class BallPen extends SharpPencil { String color; public String getColor() { return color; } public void setColor(String color) { this.color = color; } } class FountainPen extends BallPen { public void refill(int n) { setAmount(n); } } class Person{ private int age; private String name; public Person() { System.out.println("Person의 기본 생성자"); } public Person(int age) { this.age=age; System.out.println("Person의 나이 생성자"); } int getAge() { return age; } } class Student extends Person{ public Student() { System.out.println("Student의 기본 생성자"); } public Student(int a) { System.out.println("Student의 나이 생성자"); } } class Main{ public static void main(String[] args) { Student s = new Student(10); System.out.println(s.getAge()); } } /* class Point{ private int x,y; public Point() { this.x=this.y=0; } public Point(int x,int y) { this.x=x; this.y=y; } public void show() { System.out.println("("+x+","+y+")"); } } class ColorPoint extends Point{ private String color; public ColorPoint(int x,int y,String color) { super(x,y); this.color=color; } public void show() { // 부모클래스의 메소드를덮어씌우기 overriding super.show((http://super.show)); System.out.println(color); } // public void showColorPoint() // { // System.out.print(color); // showPoint(); // } } public class Main { public static void main(String[] args) { ColorPoint cp=new ColorPoint(5,6,"blue"); Point p= new Point(2,3); p.show((http://p.show)); cp.show((http://cp.show)); } } 추상클래스 abstract - "틀"의 역할로 존재하는것 (중복되는 부분을 한번만 쓰기위해서) (그냥 슈퍼클래스로만 사용) 객체를 생성할 수 없음. interface Animal{ //그냥 메소드도 가질수 없음, 오직 추상메소드만! abstract void eat(); } abstract class Person{ private int age; private String name; abstract void speak(); //추상메소드 (서브클래스가 무조건 오버라이딩해야함) void sleep() {}; // 추상메소드 아님!! (그냥 내용이 없는 메소드일뿐) } class Student extends Person implements Animal{ public Student() { System.out.println("Student의 기본 생성자"); } public Student(int a) { System.out.println("Student의 나이 생성자"); } @Override void speak() { //이 메소드는 꼭 작성해야함 -> Person의 추상메소드이기 때문에 } @Override public void eat() { // TODO Auto-generated method stub } } class Main{ public static void main(String[] args) { Student s = new Student(10); } } */ class TV{ private int size; public TV(int size) {this.size=size;} protected int getSize() {return size;} } class ColorTV extends TV { int color; public ColorTV(int size ,int color) { super(size); this.color=color; } public void printProperty() { System.out.print(getSize()+"인치 "+color+"컬러"); } } + class Main{ public static void main(String[] args) { ColorTV myTV=new ColorTV(32,1024); myTV.printProperty(); } }
0
0
5
jisung0215
2023년 12월 04일
In 소스 코드 제출
class SharpPencil{ private int width; int amount; public int getAmount() {return amount;} public void setAmount(int amount) {this.amount=amount;} } class BallPen extends SharpPencil{ String color; public int getAmount() {return amount;} public void setAmount(int amount) {this.amount=amount;} public String getColor() {return color;} public void setColor(String color) {this.color=color;} } class FountainPen extends BallPen{ public int getAmount() {return amount; } public void setAmount(int amount) {this.amount=amount; } public String getColor() {return color; } public void setColor(String color ) {this.color=color; } public void refill(int n) {amount=n; } }
0
0
2
jisung0215
2023년 11월 28일
In 소스 코드 제출
///////*5968-+5*98 //////class ArrayUtil { ////// public static int [] concat(int[] a,int[] b) { ////// int[] c = new int[a.length+b.length]; ////// for(int j=0;j<a.length;j++) ////// { ////// c[j]=a[j]; ////// } ////// for(int k=0;k<b.length;k++) ////// { ////// c[a.length+k]=b[k]; ////// } ////// return c; ////// } ////// public static void print(int [] c) ////// { ////// System.out.print("[ "); ////// for(int i=0;i<c.length;i++) ////// { ////// System.out.print(c[i]+" "); ////// } ////// System.ou-t.print(" ]"); ////// } ////// 7777777+++ //////} //////class Main { ////// ////// public static void main(String[] args) { ////// int[] array1 = { 1, 5, 7, 9 }; ////// ////// int[] array2 = { 3, 6, -1, 100, 77 }; ////// ////// int[] array3 = ArrayUtil.concat(array1, array2); ////// ////// ArrayUtil.print(array3); ////// } //////}*/ //////// Student 클래스가 Person 클래스를 상속받았다. ////////Person은 Student 의 부모 클래스 (슈퍼 클래스) ////////Student 는 Person의 자식 클래스 (서브 클래스) ////////extend : 확장하다! 넓히다! //////-*-* ///////54class Person { ////// private String name; ////// private int age; //////} //////class Student extends Person{ // Person이라는 클래스를 확장해서 클래스를 만들어요! ////// String school; ////// String grade; ////// public Student() { ////// //name="aaa"; //private 이기때문에 접근 불가능! ////// } //////} //////class Teacher extends Person{ ////// String school; ////// String subject; //////} ////// //////class Main{ ////// public static void main(String[] args) { ////// Student s = new Student(); ////// } //////} ////class Point{ //// private int x,y; //// public void set(int x,int y) { //// this.x=x; //// this.y=y; //// } //// public void showPoint() { //// System.out.println("("+x+','+y+")"); //// } ////} ////class ColorPoint extends Point{ //// private String color; //// public void setColor(String color) { //// this.color=color; //// } //// public void showColorPoint(){ //// System.out.print(color); //// showPoint(); //// } ////} ////public class Main{ //// public static void main(String[] args) { //// Point p=new Point(); //// p.set(1, 2); //// p.showPoint(); //// //// ColorPoint cp=new ColorPoint(); //// cp.set(3, 4); //// cp.setColor("red"); //// cp.showColorPoint(); //// } ////} //a class SharpPencil{ private int width; private int amount; public int getAmount() {return amount;} public void setAmount(int amount) {this.amount=amount;} }
0
0
3
jisung0215
2023년 11월 27일
In 소스 코드 제출
class ArrayUtil{ public static int [] concat(int[] a,int[] b) { a=a+b; } publc static void print(int[] a) { System.out.print(a); } } class Main{ public class StatixEx{ public static void main(String [] args) { int []array1= {1,5,7,9}; int []array2= {3,6,-1,100,77}; int []array3= ArrayUtil.concat(array1,array2); ArrayUtil.print(array3); } }
0
0
2
jisung0215
2023년 11월 21일
In 소스 코드 제출
//import java.util.*; //class Day{ // private String work; // public void set(String work) {this.work=(http://this.work)work;} // public String get() {return work;} // public void show() { // if(work==null) // {S // System.out.println("없습니다"); // } // else // { // System.out.println(work+"입니다"); // } // } //} //class Main //{ // public static void main(String[] args) { // Scanner sc=new Scanner(System.in)(http://System.in); // System.out.println("이번달 스케쥴 관리 프로그램."); // Day[] april= new Day[35]; // for(int i=0;i<35;i++) april[i] = new Day(); // for(;;) // { // System.out.print("할일(입력:1, 보기:2, 끝내기:3)>>"); // int choice=sc.nextInt(); // if(choice==1) // { // System.out.print("날짜(1~30)? "); // int a=sc.nextInt(); // System.out.print("할일 (빈칸없이 입력)? "); // String schedule=sc.next(); // april[a].set(schedule); // } // else if(choice==2) // { // System.out.print("날짜(1~30)? "); // int a=sc.nextInt(); // System.out.print(a+"일의 할 일은 "); // april[a].show(); // } // else // { // System.out.println("프로그램을 종료합니다."); // return ; // } // } // // } //} //import java.util.*; // //class Number { // // String tel; // // String name; // // Number(String tel, String name) // // { // // this.tel (http://this.tel)= tel; // // this.name (http://this.name)= name; // // } // // void show() { // // System.out.println(name + "의 번호는 " + tel + "입니다"); // } // //} // //class Main // //{ // // public static void main(String[] args) { // // Scanner sc = new Scanner(System.in)(http://System.in); // // Number[] a = new Number[101]; // // System.out.print("인원수>>"); // // int s = sc.nextInt(); // // for (int i = 0; i < s; i++) // // { // // System.out.print("이름과 전화번호(이름과 번호는 빈칸없이 입력)>>"); // // String name = sc.next((http://sc.next)); // String tel = sc.next((http://sc.next)); // a[i]=new Number(tel,name); // // } // System.out.println("저장되었습니다..."); // while(true) // { // System.out.print("검색할이름>>"); // String x=sc.next(); // if(x.equals("그만")) // { // return ; // } // int flag=0; // for(int i=0;i<s;i++) // { // if(x.equals(a[i].name)) // { // a[i].show(); // flag=1; // } // } // if(flag==0) // { // System.out.println(x+"이 없습니다"); // } // } // // } // //} import java.util.*; class Dictionary{ private static String [] kor= {"사랑","아기","돈","미래","희망"}; private static String [] eng= {"love","baby","money","future","hope"}; public static String kor2Eng(String word) { for(int i=0;i<kor.length;i++) { if(word.equals(kor[i])) { return eng[i]; } } return "저의 사전에 없습니다."; } } class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in)(http://System.in); System.out.println("한영 단어 검색 프로그램입니다."); while(true) { System.out.print("한글단어?"); String x=sc.next(); if(x.equals("그만")) { return ; } System.out.println(x+"은"+Dictionary.kor2Eng(x)); } } }
0
0
1
jisung0215
2023년 11월 20일
In 소스 코드 제출
import java.util.*; class Number{ int num; String name; void Number(int num,String name)  { this.num=num; this.n(http://this.name)ame=(http://this.name)name; } void show() { if(num==0) { System.out.println("이 없습니다"); } else { System.out.println(name+"의 번호는 "+num+"입니다"); } } } class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.i(http://System.in)n)(http://System.in); Number[] a= new Number[101]; System.out.print("인원수>>"); int s=sc.nextInt(); for(int i=0;i<s;i++) { System.out.print("이름과 전화번호(이름과 번호는 빈칸없이 입력)>>"); String name=sc.next(); int num=sc.nextInt(); } } }..
0
0
3
jisung0215
2023년 11월 14일
In 소스 코드 제출
import java.util.*; class Day{ private String work; public void set(String work) {this.work=(http://this.work)work;} public String get() {return work;} public void show() { if(work==null) { System.out.println("없습니다"); } else { System.out.println(work+"입니다"); } } } class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in)(http://System.in); System.out.println("이번달 스케쥴 관리 프로그램."); Day[] april= new Day[35]; for(int i=0;i<35;i++) april[i] = new Day(); for(;;) { System.out.print("할일(입력:1, 보기:2, 끝내기:3)>>"); int choice=sc.nextInt(); if(choice==1) { System.out.print("날짜(1~30)? "); int a=sc.nextInt(); System.out.print("할일 (빈칸없이 입력)? "); String schedule=sc.next(); april[a].set(schedule); } else if(choice==2) { System.out.print("날짜(1~30)? "); int a=sc.nextInt(); System.out.print(a+"일의 할 일은 "); april[a].show(); } else { System.out.println("프로그램을 종료합니다."); return ; } } } }
0
0
4
jisung0215
2023년 11월 07일
In 소스 코드 제출
// //////import java.util.*; //////public class Main{ ////// public static void main(String[] args) { ////// Scanner sc=new Scanner(System.in)(http://System.in); ////// int a=sc.nextInt(); ////// int s=1; ////// for(int i=a;i>0;i--) ////// { ////// s*=i; ////// } ////// System.out.println(s); ////// ////// } //////} //////import java.util.*; //////public class Main{ ////// public static void main(String[] args) { ////// Scanner sc=new Scanner(System.in)(http://System.in); ////// int a=sc.nextInt(); ////// int s=1; ////// for(int i=0;i<a;i++) ////// { ////// for(int j=0;j<s;j++) ////// { ////// System.out.print("*"); ////// } ////// System.out.print("\n"); ////// s+=1; ////// } ////// } //////} //////import java.util.*; //////public class Main{ ////// public static void main(String[] args) { ////// Scanner sc=new Scanner(System.in)(http://System.in); ////// int a=sc.nextInt(); ////// int s=0; ////// for(int i=0;i<a;i++) ////// { ////// ////// for(int j=0;j<s;j++) ////// { ////// System.out.print(" "); ////// } ////// System.out.println("**"); ////// ////// ////// s+=1; ////// } ////// } //////} //////import java.util.*; //////public class Main{ ////// public static void main(String[] args) { ////// Scanner sc=new Scanner(System.in)(http://System.in); ////// int a=sc.nextInt(); ////// int s=0; ////// s=a-1; ////// for(int i=0;i<a;i++) ////// { ////// for(int j=0;j<s ;j++) ////// { ////// System.out.print(" "); ////// } ////// for(int k=0;k<a ;k++) ////// { ////// System.out.print("*"); ////// ////// } ////// System.out.print("\n"); ////// s-=1; ////// } ////// } //////} /////* ////int arr[50]; //// ////자바에서의 배열 선언! ////int[] arr ; //int배열 arr 선언 ////arr = new int[50]; //int공간 50칸 선언 //// ////int[] a = new int[n]; //c와 달리 변수 갯수로도 선언이 가능하다!!! //// -> a.length //// ////String[] s = new String[50]; //// ////int[][] a2 = new int[10][10]; //이차원 배열 ////*/ //// //////class Main{ ////// public static void main(String[] args) { ////// int[] arr = new int[5]; ////// for(int i=0;i<arr.length;i++) { ////// System.out.println(arr[i]); ////// } ////// } //////} //// //////import java.util.*; //////public class Main{ ////// public static void main(String[] args) { ////// Scanner sc=new Scanner(System.in)(http://System.in); ////// int a=sc.nextInt(); ////// int[] arr=new int[a+1]; ////// for(int i=1;i<=a;i++) ////// { ////// arr[i] = sc.nextInt(); ////// } ////// for(int i=a;i>=1;i--) ////// { ////// System.out.print(arr[i]+" "); ////// } ////// ////// ////// } //////} //// /////* ////import java.util.*; ////public class Main{ //// public static void main(String[] args) { //// Scanner sc=new Scanner(System.in)(http://System.in); //// int[] arr=new int[11]; //// for(int i=1;i<=10;i++) //// { //// arr[i]=sc.nextInt(); //// } //// int a=sc.nextInt(); //// System.out.println(arr[a]); //// } ////}*/ //////import java.util.*; //////public class Main{ ////// public static void main(String[] args) { ////// Scanner sc=new Scanner(System.in)(http://System.in); ////// int a=sc.nextInt(); ////// int[] arr=new int[1001]; ////// for(int i=0;i<a;i++) ////// { ////// arr[i]=sc.nextInt(); ////// } ////// for(int i=0;i<a;i++) ////// { ////// System.out.print(i+1+": "); ////// for(int j=0;j<a;j++) ////// { ////// if(j==i) ////// { ////// ////// } ////// else ////// { ////// if(arr[i]>arr[j]) ////// { ////// System.out.print("> "); ////// } ////// else if(arr[i]<arr[j]) ////// { ////// System.out.print("< "); ////// } ////// else ////// { ////// System.out.print("= "); ////// } ////// } ////// } ////// System.out.print("\n"); ////// } ////// } //////} //////import java.util.*; //////public class Main{ ////// public static void main(String[] args) { ////// Scanner sc=new Scanner(System.in)(http://System.in); ////// int a=sc.nextInt(); ////// int k=1; ////// int[][] arr=new int[a][a]; ////// ////// for(int j=0;j<a;j++) ////// { ////// for(int i=0;i<a;i++) ////// { ////// arr[i][j]=k++; ////// } ////// } ////// ////// ////// for(int i=0;i<a;i++) ////// { ////// for(int j=0;j<a;j++) ////// { ////// System.out.print(arr[i][j]+" "); ////// } ////// System.out.println(); ////// } ////// } //////} //////import java.util.*; //////public class Main{ ////// public static void main(String[] args) { ////// Scanner sc=new Scanner(System.in)(http://System.in); ////// int n=sc.nextInt(); ////// int m=sc.nextInt(); ////// int[][] arr=new int[n][m]; ////// int s=1; ////// ////// for(int i=n-1;i>=0;i--) ////// { ////// for(int j=m-1;j>=0;j--) ////// { ////// arr[i][j]=s++; ////// } ////// } ////// for(int i=0;i<n;i++) ////// { ////// for(int j=0;j<m;j++) ////// { ////// System.out.print(arr[i][j]+" "); ////// } ////// System.out.print("\n"); ////// } ////// ////// sc.close(); ////// } //////} //////import java.util.*; //////public class Main{ ////// public static void main(String[] args) { ////// Scanner sc=new Scanner(System.in)(http://System.in); ////// String a=sc.nextLine(); ////// //a[i] (x) ////// //a.charAt(i) (o) ////// for(int i=0;i<a.length();i++) { ////// if(a.charAt(i)!=' ') ////// { ////// System.out.print(a.charAt(i)); ////// } ////// ////// } ////// ////// } //////} //////import java.util.*; //////public class Main{ ////// public static void main(String[] args) { ////// Scanner sc=new Scanner(System.in)(http://System.in); ////// String a=sc.next(); ////// for(int i=0;i<a.length();i++) ////// { ////// System.out.println("'"+a.charAt(i)+"'"); ////// } ////// } //////} //////import java.util.*; //////public class Main{ ////// public static void main(String[] args) { ////// Scanner sc=new Scanner(System.in)(http://System.in); ////// String a=sc.next(); ////// for(int i=0;i<a.length();i++) ////// { ////// //if(a.charAt(i)=='l'&&a.charAt(i+1)=='o'&&a.charAt(i+2)=='v'&&a.charAt(i+3)=='e'&&a.charAt(i+4)==null) ////// if(a.equals("love")) ////// { ////// System.out.println("I love you."); ////// break; ////// } ////// } ////// ////// } //////} //// //////c 함수 = java 메소드 //////import java.util.*; //////class Main{ ////// static int g(int a,int b) { ////// return a*10; ////// } ////// static void f() { ////// System.out.println("hello"); ////// } ////// public static void main(String[] args) { ////// f(); ////// System.out.println(g(10,20)); ////// ////// } //////} //////import java.util.*; //////class Main{ ////// public static void main(String[] args) { ////// f(); ////// } ////// static void f() { ////// System.out.println("A"); ////// } //////} //////import java.util.*; //////class Main{ ////// static void f(int a) { ////// if(a==1) ////// { ////// System.out.println("hello"); ////// } ////// else ////// { ////// System.out.println("world"); ////// } ////// ////// } ////// public static void main(String[] args) { ////// Scanner sc=new Scanner(System.in)(http://System.in); ////// int a=sc.nextInt(); ////// f(a); ////// ////// ////// } ////// //////} //////import java.util.*; //////class Main{ ////// static void f(int n) ////// { ////// for(int i=0;i<n;i++) ////// { ////// System.out.print("*"); ////// } ////// } ////// public static void main(String[] args) { ////// Scanner sc=new Scanner(System.in)(http://System.in); ////// int n=sc.nextInt(); ////// f(n); ////// } //////} //////import java.util.*; //////class Main{ ////// static char f(int a) ////// { ////// if(a>=90) ////// { ////// return 'A'; ////// } ////// else if(a>=80) ////// { ////// return 'B'; ////// } ////// else if(a>=70) ////// { ////// return 'C'; ////// } ////// else if(a>=60) ////// { ////// return 'D'; ////// } ////// else ////// { ////// return 'F'; ////// } ////// ////// ////// } ////// public static void main(String[] args) { ////// Scanner sc=new Scanner(System.in)(http://System.in); ////// int a=sc.nextInt(); ////// f(a); ////// System.out.println(f(a)); ////// } //////} //////import java.util.*; //////public class Main{ ////// static long f(long a) ////// { ////// ////// long b=0; ////// for(int i=1;i<=a;i++) ////// { ////// b+=i; ////// } ////// return b; ////// } ////// public static void main(String[] args) { ////// Scanner sc=new Scanner(System.in)(http://System.in); ////// long a=sc.nextInt(); ////// System.out.println(f(a)); ////// } //////} ////import java.util.*; ////public class Main{ //// static long[] arr; //// //// public static void main(String[] args) { //// Scanner sc=new Scanner(System.in)(http://System.in); //// int n=sc.nextInt(); //// arr=new long[1001]; //// for(int i=1;i<=n;i++) //// { //// arr[i]=sc.nextInt(); //// } //// int a=sc.nextInt(); //// int b=sc.nextInt(); //// f(a,b); //// System.out.println(f(a,b)); //// } //// static long f(int a,int b) //// { //// long d=0; //// for(int i=a;i<=b;i++) //// { //// d+=arr[i]; //// } //// return d; //// } ////} ////import java.util.Scanner; ////class Circle { //// double x, y; //// int radius; //// public Circle(double x, double y, int radius) { //// this.x = x; //// this.y = y; //// this.radius = radius; //// } //// public void show() //// { //// System.out.println("(" + x + "," + y + ")" + radius); //// } ////} ////class Main ////{ //// public static void main(String[] args) { //// int imax=0; //// int max=0; //// Scanner scanner = new Scanner(System.in)(http://System.in); //// //// Circle c[] = new Circle[3]; //// //// for (int i = 0; i < c.length; i++) { //// //// System.out.print("x,y,radius >>"); //// //// double x=scanner.nextDouble(); //// double y=scanner.nextDouble(); //// int radius=scanner.nextInt(); //// c[i]=new Circle(x,y,radius); //// //// } //// for (int i = 0; i < c.length; i++) //// { //// c[i].show(); //// if(c[i].radius>max) //// { //// max=c[i].radius; //// imax=i; //// } //// //// } //// System.out.print("가장 면적이 큰 원은 "); //// c[imax].show(); //// //// scanner.close(); //// } ////} // //// static : // ////class Person{ //// static void speak() { //// //name="지성"; //// System.out.println("저는 사람 클래스로 만든 객체 입니다!!!"); //// } //// static String air="나쁨";//클래스마다 생성 //// String name; //// final int age=10; //상수 ////} //// ////class Main{ //// public static void main(String[] args) { //// Person p = new Person(); //// Person s = new Person(); //// Person.speak(); //// p.air="좋음"; //// System.out.println(s.air); //// } ////} // ////변수 : 내용물이 변할 수 있는 필드 ////상수 : 내용물이 항상 똑같은(바꿀수없는) 필드 -> 선언할때 맨 앞에 final 이라고 붙이기 // //import java.util.*; // ////class A { //// //// //// String name; //// //// String n; //// //// int a; //// //// int lastIndex = word.length() - 1; //// //// char lastChar = word.charAt(lastIndex); //// //// char firstChar = word.charAt(0); //// //// public A(int a, int li, char lc, char f) //// //// { //// //// this.a = a; //// //// this.lastIndex = li; //// //// this.lastChar = lc; //// //// this.firstChar = f; //// //// } //// ////} // //class Player{ // String name; // Player(String name) // { // this.name=(http://this.name)name; // } //} // //class Main // //{ // // public static void main(String[]args) { // int i; // Scanner sc=new Scanner(System.in)(http://System.in); // // // // System.out.println("끝말잇기 게임을 시작합니다..."); // // System.out.print("게임에 참가하는 인원은 몇명입니까>>"); // // int a=sc.nextInt(); // Player p[]=new Player[a]; // // for(i=0;i<a;i++) // { // // System.out.print("참가자의 이름을 입력하세요>>"); // String n=sc.next(); // p[i]=new Player(n); // } // // System.out.println("시작하는 단어는 아버지입니다"); // String word = "아버지";q q // // for(;;) // { // for(i=0;i<a;i++) // { // int lastIndex = word.length() - 1; // char lastChar = word.charAt(lastIndex); // System.out.println(p[i].name+">>"); // String wo=sc.next(); // if(lastChar!=wo.charAt(0)) { // System.out.println(p[i].name+"이 졌습니다."); // /return ; // } // word=wo; // } // } // } //} import java.util.*; class Day { private String work; public void set(String work) { this.work=(http://this.work)work; } public String get() { return work; } public void show() { if(work==null)System.out.println("없습니다."); else System.out.println(work+"입니다."); } } class Main { public static void main(String[] args) { } }
0
0
7
jisung0215
2023년 11월 06일
In 소스 코드 제출
import java.util.*; class A{ String word; int a; int lastIndex=word.length()-1; char lastChar=word.charAt(lastIndex); char firstChar=word.charAt(0); public A(int a,int li,char lc,char f) { this.a=a; this.lastIndex=li; this.lastChar=lc; this.firstChar=f; } } class Main { public static void main(String[]args) { Scanner sc=new Scanner(System.i(http://System.in)n)(http://System.in); A name[]=new A[101]; System.out.println("끝말이기 게임을 시작합니다..."); System.out.print("게임에 참가하는 인원은 몇명입니까>>"); int a=sc.nextInt(); for(int i=0;i<a;i++) { System.out.print("참가자의 이름을 입력하세요>>") name[i]=sc.nextLine(); } System.out.print("시작하는 단어는 아버지입니다"); for(0) { System.out.print(name[i]+">>"); } } }
0
0
3
jisung0215
2023년 10월 31일
In 소스 코드 제출
////import java.util.*; ////public class Main{ //// public static void main(String[] args) { //// Scanner sc=new Scanner(System.in)(http://System.in); //// int a=sc.nextInt(); //// int s=1; //// for(int i=a;i>0;i--) //// { //// s*=i; //// } //// System.out.println(s); //// //// } ////} ////import java.util.*; ////public class Main{ //// public static void main(String[] args) { //// Scanner sc=new Scanner(System.in)(http://System.in); //// int a=sc.nextInt(); //// int s=1; //// for(int i=0;i<a;i++) //// { //// for(int j=0;j<s;j++) //// { //// System.out.print("*"); //// } //// System.out.print("\n"); //// s+=1; //// } //// } ////} ////import java.util.*; ////public class Main{ //// public static void main(String[] args) { //// Scanner sc=new Scanner(System.in)(http://System.in); //// int a=sc.nextInt(); //// int s=0; //// for(int i=0;i<a;i++) //// { //// //// for(int j=0;j<s;j++) //// { //// System.out.print(" "); //// } //// System.out.println("**"); //// //// //// s+=1; //// } //// } ////} ////import java.util.*; ////public class Main{ //// public static void main(String[] args) { //// Scanner sc=new Scanner(System.in)(http://System.in); //// int a=sc.nextInt(); //// int s=0; //// s=a-1; //// for(int i=0;i<a;i++) //// { //// for(int j=0;j<s ;j++) //// { //// System.out.print(" "); //// } //// for(int k=0;k<a ;k++) //// { //// System.out.print("*"); //// //// } //// System.out.print("\n"); //// s-=1; //// } //// } ////} ///* //int arr[50]; // //자바에서의 배열 선언! //int[] arr ; //int배열 arr 선언 //arr = new int[50]; //int공간 50칸 선언 // //int[] a = new int[n]; //c와 달리 변수 갯수로도 선언이 가능하다!!! // -> a.length // //String[] s = new String[50]; // //int[][] a2 = new int[10][10]; //이차원 배열 //*/ // ////class Main{ //// public static void main(String[] args) { //// int[] arr = new int[5]; //// for(int i=0;i<arr.length;i++) { //// System.out.println(arr[i]); //// } //// } ////} // ////import java.util.*; ////public class Main{ //// public static void main(String[] args) { //// Scanner sc=new Scanner(System.in)(http://System.in); //// int a=sc.nextInt(); //// int[] arr=new int[a+1]; //// for(int i=1;i<=a;i++) //// { //// arr[i] = sc.nextInt(); //// } //// for(int i=a;i>=1;i--) //// { //// System.out.print(arr[i]+" "); //// } //// //// //// } ////} // ///* //import java.util.*; //public class Main{ // public static void main(String[] args) { // Scanner sc=new Scanner(System.in)(http://System.in); // int[] arr=new int[11]; // for(int i=1;i<=10;i++) // { // arr[i]=sc.nextInt(); // } // int a=sc.nextInt(); // System.out.println(arr[a]); // } //}*/ ////import java.util.*; ////public class Main{ //// public static void main(String[] args) { //// Scanner sc=new Scanner(System.in)(http://System.in); //// int a=sc.nextInt(); //// int[] arr=new int[1001]; //// for(int i=0;i<a;i++) //// { //// arr[i]=sc.nextInt(); //// } //// for(int i=0;i<a;i++) //// { //// System.out.print(i+1+": "); //// for(int j=0;j<a;j++) //// { //// if(j==i) //// { //// //// } //// else //// { //// if(arr[i]>arr[j]) //// { //// System.out.print("> "); //// } //// else if(arr[i]<arr[j]) //// { //// System.out.print("< "); //// } //// else //// { //// System.out.print("= "); //// } //// } //// } //// System.out.print("\n"); //// } //// } ////} ////import java.util.*; ////public class Main{ //// public static void main(String[] args) { //// Scanner sc=new Scanner(System.in)(http://System.in); //// int a=sc.nextInt(); //// int k=1; //// int[][] arr=new int[a][a]; //// //// for(int j=0;j<a;j++) //// { //// for(int i=0;i<a;i++) //// { //// arr[i][j]=k++; //// } //// } //// //// //// for(int i=0;i<a;i++) //// { //// for(int j=0;j<a;j++) //// { //// System.out.print(arr[i][j]+" "); //// } //// System.out.println(); //// } //// } ////} ////import java.util.*; ////public class Main{ //// public static void main(String[] args) { //// Scanner sc=new Scanner(System.in)(http://System.in); //// int n=sc.nextInt(); //// int m=sc.nextInt(); //// int[][] arr=new int[n][m]; //// int s=1; //// //// for(int i=n-1;i>=0;i--) //// { //// for(int j=m-1;j>=0;j--) //// { //// arr[i][j]=s++; //// } //// } //// for(int i=0;i<n;i++) //// { //// for(int j=0;j<m;j++) //// { //// System.out.print(arr[i][j]+" "); //// } //// System.out.print("\n"); //// } //// //// sc.close(); //// } ////} ////import java.util.*; ////public class Main{ //// public static void main(String[] args) { //// Scanner sc=new Scanner(System.in)(http://System.in); //// String a=sc.nextLine(); //// //a[i] (x) //// //a.charAt(i) (o) //// for(int i=0;i<a.length();i++) { //// if(a.charAt(i)!=' ') //// { //// System.out.print(a.charAt(i)); //// } //// //// } //// //// } ////} ////import java.util.*; ////public class Main{ //// public static void main(String[] args) { //// Scanner sc=new Scanner(System.in)(http://System.in); //// String a=sc.next(); //// for(int i=0;i<a.length();i++) //// { //// System.out.println("'"+a.charAt(i)+"'"); //// } //// } ////} ////import java.util.*; ////public class Main{ //// public static void main(String[] args) { //// Scanner sc=new Scanner(System.in)(http://System.in); //// String a=sc.next(); //// for(int i=0;i<a.length();i++) //// { //// //if(a.charAt(i)=='l'&&a.charAt(i+1)=='o'&&a.charAt(i+2)=='v'&&a.charAt(i+3)=='e'&&a.charAt(i+4)==null) //// if(a.equals("love")) //// { //// System.out.println("I love you."); //// break; //// } //// } //// //// } ////} // ////c 함수 = java 메소드 ////import java.util.*; ////class Main{ //// static int g(int a,int b) { //// return a*10; //// } //// static void f() { //// System.out.println("hello"); //// } //// public static void main(String[] args) { //// f(); //// System.out.println(g(10,20)); //// //// } ////} ////import java.util.*; ////class Main{ //// public static void main(String[] args) { //// f(); //// } //// static void f() { //// System.out.println("A"); //// } ////} ////import java.util.*; ////class Main{ //// static void f(int a) { //// if(a==1) //// { //// System.out.println("hello"); //// } //// else //// { //// System.out.println("world"); //// } //// //// } //// public static void main(String[] args) { //// Scanner sc=new Scanner(System.in)(http://System.in); //// int a=sc.nextInt(); //// f(a); //// //// //// } //// ////} ////import java.util.*; ////class Main{ //// static void f(int n) //// { //// for(int i=0;i<n;i++) //// { //// System.out.print("*"); //// } //// } //// public static void main(String[] args) { //// Scanner sc=new Scanner(System.in)(http://System.in); //// int n=sc.nextInt(); //// f(n); //// } ////} ////import java.util.*; ////class Main{ //// static char f(int a) //// { //// if(a>=90) //// { //// return 'A'; //// } //// else if(a>=80) //// { //// return 'B'; //// } //// else if(a>=70) //// { //// return 'C'; //// } //// else if(a>=60) //// { //// return 'D'; //// } //// else //// { //// return 'F'; //// } //// //// //// } //// public static void main(String[] args) { //// Scanner sc=new Scanner(System.in)(http://System.in); //// int a=sc.nextInt(); //// f(a); //// System.out.println(f(a)); //// } ////} ////import java.util.*; ////public class Main{ //// static long f(long a) //// { //// //// long b=0; //// for(int i=1;i<=a;i++) //// { //// b+=i; //// } //// return b; //// } //// public static void main(String[] args) { //// Scanner sc=new Scanner(System.in)(http://System.in); //// long a=sc.nextInt(); //// System.out.println(f(a)); //// } ////} //import java.util.*; //public class Main{ // static long[] arr; // // public static void main(String[] args) { // Scanner sc=new Scanner(System.in)(http://System.in); // int n=sc.nextInt(); // arr=new long[1001]; // for(int i=1;i<=n;i++) // { // arr[i]=sc.nextInt(); // } // int a=sc.nextInt(); // int b=sc.nextInt(); // f(a,b); // System.out.println(f(a,b)); // } // static long f(int a,int b) // { // long d=0; // for(int i=a;i<=b;i++) // { // d+=arr[i]; // } // return d; // } //} //import java.util.Scanner; //class Circle { // double x, y; // int radius; // public Circle(double x, double y, int radius) { // this.x = x; // this.y = y; // this.radius = radius; // } // public void show() // { // System.out.println("(" + x + "," + y + ")" + radius); // } //} //class Main //{ // public static void main(String[] args) { // int imax=0; // int max=0; // Scanner scanner = new Scanner(System.in)(http://System.in); // // Circle c[] = new Circle[3]; // // for (int i = 0; i < c.length; i++) { // // System.out.print("x,y,radius >>"); // // double x=scanner.nextDouble(); // double y=scanner.nextDouble(); // int radius=scanner.nextInt(); // c[i]=new Circle(x,y,radius); // // } // for (int i = 0; i < c.length; i++) // { // c[i].show(); // if(c[i].radius>max) // { // max=c[i].radius; // imax=i; // } // // } // System.out.print("가장 면적이 큰 원은 "); // c[imax].show(); // // scanner.close(); // } //} // static : class Person{ static void speak() { //name="지성"; System.out.println("저는 사람 클래스로 만든 객체 입니다!!!"); } static String air="나쁨";//클래스마다 생성 String name; final int age=10; //상수 } class Main{ public static void main(String[] args) { Person p = new Person(); Person s = new Person(); Person.speak(); p.air="좋음"; System.out.println(s.air); } } //변수 : 내용물이 변할 수 있는 필드 //상수 : 내용물이 항상 똑같은(바꿀수없는) 필드 -> 선언할때 맨 앞에 final 이라고 붙이기
0
0
3
jisung0215
2023년 10월 29일
In 소스 코드 제출
import java.util.Scanner; class Circle{ private double x,y; private int radius; public Circle(double x,double y,int radius){ x=x;y=y;radius=radius; } public void show() { System.out.println("("+x+","+y+")"+radius); } } class Main { public CircleManager{ public static void main(String[] args) { Scanner scanner=new Scanner(System.i(http://System.in)n)(http://System.in); Circle c[]=new Circle[3]; for(int i=0;i<3;i++) { System.out.print("x,y,radius >>"); c[i]=new Circle(x,y); c[i]=new Circle(radius); } for(int i=0;i<c.length;i++) { System.out.print(x,y,radius); } scanner.close(); } }
0
0
2
jisung0215
2023년 10월 24일
In 소스 코드 제출
//import java.util.*; //public class Main{ // public static void main(String[] args) { // Scanner sc=new Scanner(System.in)(http://System.in); // int a=sc.nextInt(); // f(a); // } // static void f(int a) // { // int b=0; // for(int i=1;i<=a;i++) // { // if(a%i==0) // { // b+=1; // } // } // if(b==2) // { // System.out.println("prime"); // } // else // { // System.out.println("composite"); // } // // } //} //클래스 = 틀 (필드, 메소드, 생성자) //객체 //class Person{ // // 필드 ( 객체의 특성, 특징) // int age; // String name; // //생성자 (객체 생성시 필드의 초기값 설정) // Person(){ // age=-100; // name = "미정"; // } // Person(int a, String n){ // age=a; // name=n; // } // //메소드 (기능, 행동) // void speak(){ // System.out.println("저는 "+age+"살 이고, 이름은 "+name+"입니다."); // } //} //class Main{ // public static void main(String[] args) { // Person a; //레퍼런스변수 // a = new Person(); //객체 생성 // Person b = new Person(); // a.speak(); // b.speak(); // a.age = 10; // a.name (http://a.name)= "윤도윤"; // a.speak(); // Person c = new Person(100,"최성일"); // c.speak(); // } //} //자바도넛,자바피자 //class A //{ // int ba; // String name; // A() // { // // } // double Calc() // { // return 3.14*ba*ba; // } //} //class Main{ // public static void main(String[] args) { // A pizza=new A(); // pizza.ba=(http://pizza.ba)10; // pizza.name=(http://pizza.name)"자파피자"; // double Calc=pizza.Calc(); // System.out.println(pizza.name+(http://pizza.name)"의 면적은 "+Calc); // A donut=new A(); // donut.ba=(http://donut.ba)2; // donut.name=(http://donut.name)"자바도넛"; // Calc=donut.Calc(); // System.out.println(donut.name+(http://donut.name)"의 면적은 "+Calc); // } //} //사각형의 넓이 //import java.util.*; //class Rectangle{ // int width; // int height; // // int getArea() // { // return width*height; // } //} //class Main{ // public static void main(String[] args) { // Rectangle rect=new Rectangle(); // Scanner scanner=new Scanner(System.in)(http://System.in); // System.out.print(">> "); // rect.width=scanner.nextInt(); // rect.height=scanner.nextInt(); // System.out.println("사각형의 면적은 "+rect.getArea()); // scanner.close(); // } //} //class A{ // int radius; // String name; // A() // { // radius=1; // name=""; // } // A(int r,String n) // { // radius=r; // name=n; // } // double getArea() // { // return 3.14*radius*radius; // } //} //class Main //{ // public static void main(String[] args) { // A pizza=new A(10,"자파피자"); // double area=pizza.getArea(); // System.out.println(pizza.name+(http://pizza.name)"의 면적은 "+area); // // A donut=new A(); // donut.name=(http://donut.name)"도넛피자"; // area=donut.getArea(); // System.out.println(donut.name+(http://donut.name)"의 면적은 "+area); // } //} // // // // //class TV //{ // // String com; // int year; // int size; // // public TV(String c,int y,int s) { // com=c; // year=y; // size=s; // } // void show() { // System.out.println(com+"에서 만든 "+year+"년형 "+size+"인치 TV"); // } // //} //class Main //{ // public static void main(String[] args) { // TV myTV=new TV("LG",2017,32); // myTV.show((http://myTV.show)); // } //} //import java.util.*; //class Grade //{ // int math; // int science; // int english; // // public Grade(int m,int s,int e) // { // math=m; // science=s; // english=e; // } // public int average() // { // return (math+science+english)/3; // } // //필드 // //생성자 // //메소드 //} //class Main{ // public static void main(String[] args) { // Scanner scanner=new Scanner(System.in)(http://System.in); // System.out.print("수학, 과학, 영어 순으로 3개의 점수 입력>>"); // int math = scanner.nextInt(); // int science = scanner.nextInt(); // int english = scanner.nextInt(); // Grade me = new Grade(math,science,english); // System.out.println("평균은 "+ me.average()); // scanner.close(); // } //} //class Song //{ // String title; // String artist; // int year; // String country; // public Song() // { // // } // // // public Song(String t,String a,int y,String c) // { // title=t; // artist=a; // year=y; // country=c; // } // // void show() // { // System.out.println(year+"년 "+country+"국적의 "+artist+"가 부른 "+title); // } //} //class Main //{ // public static void main(String[] args) { // Song s = new Song("Dancing Queen","ABBA",1978,"스웨덴"); // s.show((http://s.show)); // } //} //class Circle //{ // int color; //} // //class Main{ // public static void main(String[] args) { // Circle c1 = new Circle(); // Circle c2 = new Circle(); // // Circle[] carr = new Circle[50]; // carr[4].color=10; //// for(int i=0;i<carr.length;i++) //// carr[i] = new Circle(); // // //int[] arr = new int[50]; // } //} //겍체 배열 만들기 //class Circle{ // int radius; // public Circle(int radius) { // this.radius=radius; // } // public double getArea() { // return 3.14*radius*radius; // } // //} //public class Main{ // public static void main(String[] args) { // Circle[] c; // c=new Circle[5]; // for(int i=0;i<c.length;i++) // c[i]=new Circle(i); // for(int i=0;i<c.length;i++) // { // System.out.print((int)(c[i].getArea())+" "); // } // } // //} //import java.util.Scanner; //class Book{ // String title,author; // public Book(String title,String author) { // this.title=title; // this.author=(http://this.author)author; // } //} //public class Main{ // public static void main(String[] args) { // Book[]book=new Book[2]; // Scanner scanner=new Scanner(System.in)(http://System.in); // for(int i=0;i<book.length;i++) { // System.out.print("제목>>"); // String title=scanner.nextLine(); // System.out.print("저자>>"); // String author=scanner.nextLine(); // book[i]=new Book(title,author); // } // for(int i=0;i<book.length;i++) // { // System.out.print("("+book[i].title+", "+book[i].author+")"); // } // } //} import java.util.Scanner; class Circle{ private double x,y; private int radius; public Circle(double x,double y,int radius){ x=x;y=y;radius=radius; } public void show() }
0
0
3
jisung0215
2023년 10월 03일
In 소스 코드 제출
//import java.util.*; //public class Main{ // public static void main(String[] args) { // Scanner sc=new Scanner(System.in)(http://System.in); // int a=sc.nextInt(); // f(a); // } // static void f(int a) // { // int b=0; // for(int i=1;i<=a;i++) // { // if(a%i==0) // { // b+=1; // } // } // if(b==2) // { // System.out.println("prime"); // } // else // { // System.out.println("composite"); // } // // } //} //클래스 = 틀 (필드, 메소드, 생성자) //객체 //class Person{ // // 필드 ( 객체의 특성, 특징) // int age; // String name; // //생성자 (객체 생성시 필드의 초기값 설정) // Person(){ // age=-100; // name = "미정"; // } // Person(int a, String n){ // age=a; // name=n; // } // //메소드 (기능, 행동) // void speak(){ // System.out.println("저는 "+age+"살 이고, 이름은 "+name+"입니다."); // } //} //class Main{ // public static void main(String[] args) { // Person a; //레퍼런스변수 // a = new Person(); //객체 생성 // Person b = new Person(); // a.speak(); // b.speak(); // a.age = 10; // a.name (http://a.name)= "윤도윤"; // a.speak(); // Person c = new Person(100,"최성일"); // c.speak(); // } //} //자바도넛,자바피자 //class A //{ // int ba; // String name; // A() // { // // } // double Calc() // { // return 3.14*ba*ba; // } //} //class Main{ // public static void main(String[] args) { // A pizza=new A(); // pizza.ba=(http://pizza.ba)10; // pizza.name=(http://pizza.name)"자파피자"; // double Calc=pizza.Calc(); // System.out.println(pizza.name+(http://pizza.name)"의 면적은 "+Calc); // A donut=new A(); // donut.ba=(http://donut.ba)2; // donut.name=(http://donut.name)"자바도넛"; // Calc=donut.Calc(); // System.out.println(donut.name+(http://donut.name)"의 면적은 "+Calc); // } //} //사각형의 넓이 //import java.util.*; //class Rectangle{ // int width; // int height; // // int getArea() // { // return width*height; // } //} //class Main{ // public static void main(String[] args) { // Rectangle rect=new Rectangle(); // Scanner scanner=new Scanner(System.in)(http://System.in); // System.out.print(">> "); // rect.width=scanner.nextInt(); // rect.height=scanner.nextInt(); // System.out.println("사각형의 면적은 "+rect.getArea()); // scanner.close(); // } //} //class A{ // int radius; // String name; // A() // { // radius=1; // name=""; // } // A(int r,String n) // { // radius=r; // name=n; // } // double getArea() // { // return 3.14*radius*radius; // } //} //class Main //{ // public static void main(String[] args) { // A pizza=new A(10,"자파피자"); // double area=pizza.getArea(); // System.out.println(pizza.name+(http://pizza.name)"의 면적은 "+area); // // A donut=new A(); // donut.name=(http://donut.name)"도넛피자"; // area=donut.getArea(); // System.out.println(donut.name+(http://donut.name)"의 면적은 "+area); // } //} // // // //
0
0
4
jisung0215
2023년 9월 26일
In 소스 코드 제출
//import java.util.*; //public class Main{ // public static void main(String[] args) { // Scanner sc=new Scanner(System.in)(http://System.in); // int a=sc.nextInt(); // int s=1; // for(int i=a;i>0;i--) // { // s*=i; // } // System.out.println(s); // // } //} //import java.util.*; //public class Main{ // public static void main(String[] args) { // Scanner sc=new Scanner(System.in)(http://System.in); // int a=sc.nextInt(); // int s=1; // for(int i=0;i<a;i++) // { // for(int j=0;j<s;j++) // { // System.out.print("*"); // } // System.out.print("\n"); // s+=1; // } // } //} //import java.util.*; //public class Main{ // public static void main(String[] args) { // Scanner sc=new Scanner(System.in)(http://System.in); // int a=sc.nextInt(); // int s=0; // for(int i=0;i<a;i++) // { // // for(int j=0;j<s;j++) // { // System.out.print(" "); // } // System.out.println("**"); // // // s+=1; // } // } //} //import java.util.*; //public class Main{ // public static void main(String[] args) { // Scanner sc=new Scanner(System.in)(http://System.in); // int a=sc.nextInt(); // int s=0; // s=a-1; // for(int i=0;i<a;i++) // { // for(int j=0;j<s ;j++) // { // System.out.print(" "); // } // for(int k=0;k<a ;k++) // { // System.out.print("*"); // // } // System.out.print("\n"); // s-=1; // } // } //} /* int arr[50]; 자바에서의 배열 선언! int[] arr ; //int배열 arr 선언 arr = new int[50]; //int공간 50칸 선언 int[] a = new int[n]; //c와 달리 변수 갯수로도 선언이 가능하다!!! -> a.length String[] s = new String[50]; int[][] a2 = new int[10][10]; //이차원 배열 */ //class Main{ // public static void main(String[] args) { // int[] arr = new int[5]; // for(int i=0;i<arr.length;i++) { // System.out.println(arr[i]); // } // } //} //import java.util.*; //public class Main{ // public static void main(String[] args) { // Scanner sc=new Scanner(System.in)(http://System.in); // int a=sc.nextInt(); // int[] arr=new int[a+1]; // for(int i=1;i<=a;i++) // { // arr[i] = sc.nextInt(); // } // for(int i=a;i>=1;i--) // { // System.out.print(arr[i]+" "); // } // // // } //} /* import java.util.*; public class Main{ public static void main(String[] args) { Scanner sc=new Scanner(System.in)(http://System.in); int[] arr=new int[11]; for(int i=1;i<=10;i++) { arr[i]=sc.nextInt(); } int a=sc.nextInt(); System.out.println(arr[a]); } }*/ //import java.util.*; //public class Main{ // public static void main(String[] args) { // Scanner sc=new Scanner(System.in)(http://System.in); // int a=sc.nextInt(); // int[] arr=new int[1001]; // for(int i=0;i<a;i++) // { // arr[i]=sc.nextInt(); // } // for(int i=0;i<a;i++) // { // System.out.print(i+1+": "); // for(int j=0;j<a;j++) // { // if(j==i) // { // // } // else // { // if(arr[i]>arr[j]) // { // System.out.print("> "); // } // else if(arr[i]<arr[j]) // { // System.out.print("< "); // } // else // { // System.out.print("= "); // } // } // } // System.out.print("\n"); // } // } //} //import java.util.*; //public class Main{ // public static void main(String[] args) { // Scanner sc=new Scanner(System.in)(http://System.in); // int a=sc.nextInt(); // int k=1; // int[][] arr=new int[a][a]; // // for(int j=0;j<a;j++) // { // for(int i=0;i<a;i++) // { // arr[i][j]=k++; // } // } // // // for(int i=0;i<a;i++) // { // for(int j=0;j<a;j++) // { // System.out.print(arr[i][j]+" "); // } // System.out.println(); // } // } //} //import java.util.*; //public class Main{ // public static void main(String[] args) { // Scanner sc=new Scanner(System.in)(http://System.in); // int n=sc.nextInt(); // int m=sc.nextInt(); // int[][] arr=new int[n][m]; // int s=1; // // for(int i=n-1;i>=0;i--) // { // for(int j=m-1;j>=0;j--) // { // arr[i][j]=s++; // } // } // for(int i=0;i<n;i++) // { // for(int j=0;j<m;j++) // { // System.out.print(arr[i][j]+" "); // } // System.out.print("\n"); // } // // sc.close(); // } //} //import java.util.*; //public class Main{ // public static void main(String[] args) { // Scanner sc=new Scanner(System.in)(http://System.in); // String a=sc.nextLine(); // //a[i] (x) // //a.charAt(i) (o) // for(int i=0;i<a.length();i++) { // if(a.charAt(i)!=' ') // { // System.out.print(a.charAt(i)); // } // // } // // } //} //import java.util.*; //public class Main{ // public static void main(String[] args) { // Scanner sc=new Scanner(System.in)(http://System.in); // String a=sc.next(); // for(int i=0;i<a.length();i++) // { // System.out.println("'"+a.charAt(i)+"'"); // } // } //} //import java.util.*; //public class Main{ // public static void main(String[] args) { // Scanner sc=new Scanner(System.in)(http://System.in); // String a=sc.next(); // for(int i=0;i<a.length();i++) // { // //if(a.charAt(i)=='l'&&a.charAt(i+1)=='o'&&a.charAt(i+2)=='v'&&a.charAt(i+3)=='e'&&a.charAt(i+4)==null) // if(a.equals("love")) // { // System.out.println("I love you."); // break; // } // } // // } //} //c 함수 = java 메소드 //import java.util.*; //class Main{ // static int g(int a,int b) { // return a*10; // } // static void f() { // System.out.println("hello"); // } // public static void main(String[] args) { // f(); // System.out.println(g(10,20)); // // } //} //import java.util.*; //class Main{ // public static void main(String[] args) { // f(); // } // static void f() { // System.out.println("A"); // } //} //import java.util.*; //class Main{ // static void f(int a) { // if(a==1) // { // System.out.println("hello"); // } // else // { // System.out.println("world"); // } // // } // public static void main(String[] args) { // Scanner sc=new Scanner(System.in)(http://System.in); // int a=sc.nextInt(); // f(a); // // // } // //} //import java.util.*; //class Main{ // static void f(int n) // { // for(int i=0;i<n;i++) // { // System.out.print("*"); // } // } // public static void main(String[] args) { // Scanner sc=new Scanner(System.in)(http://System.in); // int n=sc.nextInt(); // f(n); // } //} //import java.util.*; //class Main{ // static char f(int a) // { // if(a>=90) // { // return 'A'; // } // else if(a>=80) // { // return 'B'; // } // else if(a>=70) // { // return 'C'; // } // else if(a>=60) // { // return 'D'; // } // else // { // return 'F'; // } // // // } // public static void main(String[] args) { // Scanner sc=new Scanner(System.in)(http://System.in); // int a=sc.nextInt(); // f(a); // System.out.println(f(a)); // } //} //import java.util.*; //public class Main{ // static long f(long a) // { // // long b=0; // for(int i=1;i<=a;i++) // { // b+=i; // } // return b; // } // public static void main(String[] args) { // Scanner sc=new Scanner(System.in)(http://System.in); // long a=sc.nextInt(); // System.out.println(f(a)); // } //} import java.util.*; public class Main{ static long[] arr; public static void main(String[] args) { Scanner sc=new Scanner(System.in)(http://System.in); int n=sc.nextInt(); arr=new long[1001]; for(int i=1;i<=n;i++) { arr[i]=sc.nextInt(); } int a=sc.nextInt(); int b=sc.nextInt(); f(a,b); System.out.println(f(a,b)); } static long f(int a,int b) { long d=0; for(int i=a;i<=b;i++) { d+=arr[i]; } return d; } }
0
0
2

jisung0215

더보기
bottom of page