top of page

게시판 게시물

권현수
2023년 5월 25일
In 소스 코드 제출
package 권현수; import java.util.*; //class Rectangle { // int width; // int height; // // public int getarea() { // return width*height; // } //} //public class Main { // public static void main(String[] args) { // Rectangle rect = new Rectangle(); // Scanner t = new Scanner(System.in); // System.out.print(">> "); // rect.width = t.nextInt(); // rect.height = t.nextInt(); // System.out.println("사각형의 넓이는 "+ rect.getarea()); // // } //} //class point{ // private int x, y; // public void set(int x, int y) { // this.x = x; this.y = y; // } // public void showpoint() { // System.out.printf("(%d, %d)\n", x,y); // } //} // // //class colorpoint extends point { // private String color; // public void setcolor(String color) { // this.color = color; // } // public void showcolorpoint() { // System.out.printf("%s", color); // showpoint(); // } //} // // //public class Main { // public static void main(String[] args) { // point p = new point(); // colorpoint cp = new colorpoint(); // Scanner t = new Scanner(System.in); // System.out.print(">> "); // int x = t.nextInt(); // int y = t.nextInt(); // p.set(x, y); p.showpoint(); // // // System.out.print(">> "); // x = t.nextInt(); // y = t.nextInt(); // cp.set(x, y); // String color = t.next(); // cp.setcolor(color); // cp.showcolorpoint(); // } //} //class point { // private int x1,y1,x2,y2,n,m,nm; // private float insumx, insumy; // public void set1(int x1,int y1) // { // this.x1 = x1; this.y1 = y1; // } // public void set2(int x2, int y2) { // this.x2 = x2; this.y2 = y2; // } // public void set3(int n, int m) { // this.n = n; this.m = m; // } // public void show() { // nm = n+m; // insumx = (float)((x2*n)+(x1*m))/nm; // insumy = (float)((y2*n)+(y1*m))/nm; // System.out.printf("점1과 점2를 %d : %d로 내분하는 점은 (%.2f, %.2f)입니다", n,m,insumx,insumy); // } //} // //public class Main{ // public static void main(String[] args) { // Scanner t = new Scanner(System.in); // point p = new point(); // System.out.print("점1의 좌표를 입력해주십시오 >> "); // int x1 = t.nextInt(); // int y1 = t.nextInt(); // p.set1(x1, y1); // // System.out.print("점2의 좌표를 입력해주십시오 >> "); // int x2 = t.nextInt(); // int y2 = t.nextInt(); // p.set2(x2, y2); // // System.out.print("점1과 점2를 몇 : 몇 으로 내분하시겠습니까? >> "); // int n = t.nextInt(); // int m = t.nextInt(); // p.set3(n, m); // p.show(); // // } //} //class hardtail { // private String name,gs,gc,fs,sc; // public void set(String name,String gc, String gs, String sc, String fs){ // this.name = name; this.gc = gc; this.gs = gs; this.sc = sc; this.fs = fs; // } // public void show() { // System.out.printf("본 자전거의 이름은 %s 이고 구동게는 %s사의 %s, 프론트샥은 %s사의 %s 입니다", name,gc,gs,sc,fs); // } // public void nl() { // System.out.println(); // } //} //class fullshok extends hardtail { // private String rs,rsc; // public void setrs(String rsc, String rs) { // this.rsc = rsc; this.rs = rs; // } // public void showrs() { // show(); System.out.printf(", 리어샥은 %s사의 %s 입니다\n", rsc, rs); // } //} // // //public class Main{ // public static void main(String[] args) { // hardtail ht = new hardtail(); // fullshok fs = new fullshok(); // // ht.set("그랜드캐니언6", "시마노", "DEORE", "SUNTOUR", "XCR"); // fs.set("스트라이브CFR TLD", "스램", "XX1 AEGLE AXS", "ROCKSHOX", "ZEB ULTIMATE RC2"); // fs.setrs("ROCKSHOX", "SUPER DELUXE ULTIMATE DH"); // ht.show(); ht.nl(); // fs.showrs(); // } //}
0
0
1
권현수
2023년 1월 17일
In 소스 코드 제출
import java.util.*; class Dictionary { private static String [] kor = {"사랑", "아기", "돈", "미래", "희망"}; private static String [] eng = {"love","baby","money","future","hope"}; public static void kor2eng(String word) { for(int i=0; i<5; i++) { if(kor[i].equals(word)) { System.out.printf("%s은 %s\n", word, eng[i]); return; } } System.out.printf("%s란 단어는 사전에 없습니다\n", word); return; } } public class Main{ public static void main(String[] args){ String stop = "그만"; Scanner t = new Scanner(System.in); System.out.println("한영 단어 검색 프로그램."); while(true){ System.out.print("한글 단어 >> "); String word = t.next(); if(word.equals(stop)){ return; } else{ Dictionary.kor2eng(word); } } } } * 클래스의 구성요소 속성 - 필드 기능 - 메소드 초기값 - 생성자 */ //class Person{ // private String name; // int age; // String school; // public void setName(String name) { // this.name=name; // } //} // //class Student extends Person{ // char grade; //} // //class Teacher extends Person{ // String subject; //} // //class El_Student extends Student{ // //} // //class Main{ // public static void main(String[] args) { // Person p = new Person(); // //p.name= "현수"; // p.setName("현수"); // // } //} //class point{ // private int x,y; // public void set(int x, int y) {this.x = x; this.y = y;} // public void showpoint() {System.out.printf("(%d, %d)\n", 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(); // } //} /* class Pen{ private int amount; public void setAmount(int amount) {this.amount = amount;} public int getAmount() {return amount;} } class SharpPencil extends Pen{ private int width; } class Ballpen extends Pen{ private String color; public void setColor(String color) {this.color = color;} public String getColor(String color) {return color;} } class Fountainpen extends Ballpen{ public void refill(int n) { setAmount(n); } } public class Main{ public static void main(String[] args) { SharpPencil sp = new SharpPencil(); Ballpen bp = new Ballpen(); Fountainpen ft = new Fountainpen(); } } */ //class Person { // private String name; // int age; // String school; // public Person() { // System.out.println("갑자기 이게 실행된다고?"); // } // // public Person(int age) { // this.age=age; // } // // public void setName(String name) { // this.name = name; // } //} // //class Student extends Person { // char grade; // public Student() { // super(); // System.out.println("student의 생성자"); // } // public Student(int age) { // super(age); // } //} // //public class Main { // public static void main(String[] args) { // //Person p = new Person(50); // Student s = new Student(50); // } //} //class TV{ // private int size; // public TV(int size) {this.size = size;} // protected int getsize() {return size;} //} // //class ColorTV extends TV{ // int c; // public ColorTV(int size, int color) // { // super(size); // c = color; // } // public void printProperty() { // System.out.print(getsize()+"인치 "+c+"컬러"); // } //} //public class Main{ // public static void main(String[] args) { // ColorTV myTV = new ColorTV(32, 1024); // myTV.printProperty(); // } //}
0
0
2
권현수
2023년 1월 10일
In 소스 코드 제출
//class Pl //{ // String name, word; // public Pl(String name) // { // this.name = name; // } // public void wr(String word) // { // this.word = word; // } // public boolean check(String word) // { // if(this.word.charAt(this.word.length()-1) == word.charAt(0)) // { // this.word = word; // return true; // } // else // { // System.out.println(this.name+"이/가 졌습니다."); // return false; // } // } //} //public class Main //{ // public static void main(String[] args) // { // Scanner t = new Scanner(System.in); // int m = 0, bool = 1; // System.out.println("끝말잇기 게임 시작"); // System.out.print("참가 인원은? >> "); // int n = t.nextInt(); // Pl[] pl = new Pl[n]; // for(int i=0; i < n; i++) // { // System.out.print("참가자의 이름은? >> "); // String name = t.next(); // pl[i] = new Pl(name); // } // System.out.println("시작단어 = 아버지"); // pl[0].wr("아버지"); // while(true) // { // System.out.print(pl[m].name + " >> "); // String word = t.next(); // if (pl[m].check(word)==false) // { // return ; // } // if(m==n-1) // { // m=0; // pl[m].wr(word); // } // else // { // m++; // pl[m].wr(word); // } // } // } //} /* import java.util.*; class Person{ static int num=0; //Person 클래스로 선언된 객체들이 공통으로 가지는 변수 String name; static void up() { num++; //name="hello"; } } class Mymath{ static int mysum(int a, int b) { return a+b; } } class Main{ public static void main(String[] args) { System.out.println(Mymath.mysum(10, 20)); //static 필드나 메소드는 객체를 선언하기 전에도 사용이 가능하다. Person.num++; Person.up(); System.out.println(Person.num); // Person a = new Person(); // Person b = new Person(); // // System.out.println("a.num : "+a.num); // a.num++; // System.out.println("b.num : "+b.num); // Person.num++; // System.out.println("Person.num : "+Person.num); // // a.up(); // b.up(); // Person.up(); } }*/ //class AU //{ // public static int [] cc(int[] a, int[] b) // { // int [] array = new int[a.length+b.length]; // for(int i=0; i<a.length; i++) // { // array[i] = a[i]; // } // for(int i=0; i<b.length; i++) // { // array[i+a.length] = b[i]; // } // return array; // } // public static void print(int[] a) // { // System.out.print("[ "); // for(int i=0; i<a.length-1; i++) // { // System.out.print(a[i]+", "); // } // System.out.print(a[a.length-1]+" ]"); // } //} //public class Main //{ // public static void main(String[] args) // { // int [] Array1 = {1, 5, 7, 9}; // int [] Array2 = {3, 6, -1, 100, 77}; // int [] Array3 = AU.cc(Array1, Array2); // AU.print(Array3); // } //}
0
0
1
권현수
2022년 12월 20일
In 소스 코드 제출
//class Circle //{ // int radius; // public Circle(int radius) // { // this.radius = radius; // } // public double getArea() // { // return 3.14159265358979*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.*; // // //class Circle //{ // private double x,y; // private int radius; // public Circle (double x, double y, int radius) // { // this.x = x; // this.y = y; // this.radius = radius; // } // void show() // { // System.out.printf("(%.1f,%.1f)%d\n", x,y,radius); // } //} //public class Main //{ // public static void main(String[] args) // { // Scanner t = new Scanner(System.in); // Circle[] c = new Circle[3]; // for(int i=0; i<c.length; i++) // { // System.out.print("x, y, radius >>"); // double x = t.nextDouble(); // double y = t.nextDouble(); // int radius = t.nextInt(); // c[i] = new Circle(x,y,radius); // } // for(int i=0; i<c.length; i++) c[i].show(); // } //} //import java.util.*; //class day //{ // private String work; // public void set(String work) {this.work = work;} // public String get() {return work;} // public void show() // { // if(work == null)System.out.println("? 없는디?"); // else System.out.println(work + "네 빨리 해."); // } //} // //public class Main //{ // public static void main(String[] args) // { // day[] d = new day[30]; // String work = null; // for(int i=0; i<30; i++) // { // d[i] = new day(); // } // Scanner t = new Scanner(System.in); // System.out.println("이번달 스케쥴 관리 프로그램."); // while(true) // { // System.out.print("할일(입력 : 1, 보기 : 2, 끝 : 3) >>"); // int n = t.nextInt(); // if(n==1) // { // System.out.print("날짜는?(1~30) >>"); // int m = t.nextInt(); // System.out.print("ㅇㅋ그럼 할일은?(빈칸없이) >>"); // work = t.next(); // d[m].set(work); // } // if(n==2) // { // System.out.print("날짜는?(1~30) >>"); // int m = t.nextInt(); // d[m].show(); // } // if(n==3) // { // System.out.println("ㅇㅋ꺼져드림"); // return; // } // } // } //} import java.util.*; class Pb { String name, tel; public Pb(String name, String tel) { this.name = name; this.tel = tel; } void show() { System.out.println(name+"의 전번이...."+tel+"이네"); } } public class Main { public static void main(String[] args) { Scanner t = new Scanner(System.in); System.out.print("저장할 사람의 인원수는 ?"); int peo = t.nextInt(); Pb[] pb = new Pb[peo]; for(int i=0; i<peo; i++) { System.out.print("이름과 전번(둘다 빈칸 없이) >> "); String name = t.next(); String tel =t.next(); pb[i] = new Pb(name, tel); } System.out.println("저장중이야......."); while(true) { System.out.print("검색할 사람의 이름은? >> "); String name = t.next(); if(name.equals("그만")) { return; } for(int i=0;i<pb.length;i++) { if(pb[i].name.equals(name)) { pb[i].show(); break; } if(i == pb.length-1) { System.out.println("어..... "+name+"이 없는데?"); } } } } }
0
0
1
권현수
2022년 11월 01일
In 소스 코드 제출
//import java.util.*; //class Grade //{ // int math; // int science; // int english; // int aver = 0; // // Grade(int math, int science, int english) // { // this.math = math; // this.science = science; // this.english = english; // } // int average() // { // aver+=this.math; // aver+=this.science; // aver+=this.english; // return aver/3; // } //} //class Main //{ // public static void main(String[] args) // { // Scanner t = new Scanner(System.in); // // System.out.print("수학, 과학, 영어순으로 점수 입력>>"); // int math = t.nextInt(); // int science = t.nextInt(); // int english = t.nextInt(); // Grade me = new Grade(math, science, english); // System.out.println("평균은 " + me.average()); // } //} //class Song //{ // int year; // String c; // String name; // String songname; // Song(int year, String c, String name, String songname) // { // this.year = year; // this.c = c; // this.name = name; // this.songname = songname; // } // void show() // { // System.out.println(year + "년 " + c + "국적의 " + name + "가 부른 " + songname); // } //} //class Main //{ // public static void main(String[] args) // { // Song d = new Song(1978, "스웨덴", "ABBA", "Dancing Queen"); // d.show(); // } //} /* class Rectangle { int x; int y; int width; int height; Rectangle(int x, int y, int width, int height) { this.x = x; this.y = y; this.width = width; this.height = height; } void show() { System.out.println("("+x+","+y+")에서 크기가 " + width+"X"+height+"인 사각형"); } int square() { return width*height; } boolean contains(Rectangle r) { if(r.x > this.x && r.y > this.y && r.x+r.height < this.x+this.height && r.y+r.width < this.y + this.width) { return true; } else { return false; } } } class Main { public static void main(String[] args) { Rectangle r = new Rectangle(2,2,8,7); Rectangle s = new Rectangle(5,5,6,6); Rectangle t = new Rectangle(1,1,10,10); r.show(); System.out.println("s의 면적은 " + s.square()); if(t.contains(r)) System.out.println("t는 r을 포함합니다."); if(t.contains(s)) System.out.println("t는 s를 포함합니다."); } } */ //class Person{ // int age; // String name; //} // //class Main{ // public static void main(String[] args) { // Person[] arr = // // } //} //import java.util.*; // //class Circle //{ // private double x,y; // private int radius; // // Circle(double x,double y, int radius) // { // this.x = x; // this.y = y; // this.radius = radius; // } // void show() // { // System.out.printf("(%.1f,%.1f)%d\n", x,y,radius); // } //} //class Main //{ // public static void main(String[] args) // { // Scanner t = new Scanner(System.in); // Circle[] c = new Circle[3] ; // for(int i=0; i<c.length; i++) // { // System.out.print("x y radius >>"); // double x = t.nextDouble(); // double y = t.nextDouble(); // int radius = t.nextInt(); // c[i] = new Circle(x,y,radius); // } // for(int i=0; i<c.length; i++) c[i].show(); // } //}
0
0
2
권현수
2022년 10월 25일
In 소스 코드 제출
//import java.util.*; //public class Main //{ // public static void main(String[] args) // { // Scanner t = new Scanner(System.in); // // int map[][] = new int[15][15]; // int map2[][] = new int [15][15]; // int player[][] = new int [8][2]; // for(int i=0; i<10; i++) // { // for(int j=0; j<10; j++) // { // map[i][j]=t.nextInt(); // map2[i][j] = map[i][j];//맵2에 맵1의 데이터를 복제\\ // } // } // int n=t.nextInt(); // // for(int i=0; i<n; i++) // { // player[i][0] = t.nextInt(); // player[i][1] = t.nextInt(); // } // //입력 완료 이제 노가다 시작\\ // // for(int i=0; i<10; i++) // { // for(int j=0; j<10; j++) // { // if(map[i][j] > 0)//맵1에서 폭탄있어?\\ // { // int b = map[i][j]; // int up = 0; // int down = 0; // int right = 0; // int left = 0; // for(int k=0; k<b+1; k++) // { // if(map[i+k][j] != -1 && down == 0){map[i+k][j] = -2;} // else{down=1;} // if(i-k >= 0 && map[i-k][j] != -1 && up == 0) {map[i-k][j] = -2;} // else {up=1;} // if(map[i][j+k] != -1 && right == 0) {map[i][j+k] = -2;} // else {right =1;} // if(j-k >= 0 && map[i][j-k] != -1 && left == 0) {map[i][j-k] = -2;} // else {left = 1;} // } // } // else if(map2[i][j] > 0) //아 없어? 그럼 맵 2에서 찾아봐\\ // { // int b = map2[i][j]; // int up = 0; // int down = 0; // int right = 0; // int left = 0; // for(int k=0; k<b+1; k++) // { // if(map[i+k][j] != -1 && down == 0){map[i+k][j] = -2;} // else{down=1;} // if(i-k >= 0 && map[i-k][j] != -1 && up == 0) {map[i-k][j] = -2;} // else {up=1;} // if(map[i][j+k] != -1 && right == 0) {map[i][j+k] = -2;} // else {right =1;} // if(j-k >= 0 && map[i][j-k] != -1 && left == 0) {map[i][j-k] = -2;} // else {left = 1;} // } // }//맵2에도 없어? 그럼 진짜 없는거야 돌아가서 다시 시작해\\ // } // } // //노가다 끝 플레이어 시작\\ // // for(int i=0; i<n; i++) // { // int x=player[i][0]-1; // int y=player[i][1]-1; // if(map[x][y] != -2){map[x][y] = i+1;} // else {continue;} // } // //플레이어 끝 프린트 시작\\ // // //맵 프린트\\ // for(int i=0; i<10; i++) // { // for(int j=0; j<10; j++) // { // System.out.print(map[i][j] + " "); // } // System.out.println(); // } // // System.out.println("Character Information"); // // //플레이어 상황 프린트\\ // for(int i=1; i<n+1; i++) // { // int x=player[i-1][0]-1; // int y=player[i-1][1]-1; // if(map[x][y] == i){System.out.println("player " + i + " survive");} // else {System.out.println("player " + i + " dead");} // } // } //} //접근지정자 //class Person{ // //필드 (변수) // int hair; // private int age; // private String name; // // //생성자 : 객체 생성시 필드값의 초기화 // Person(){ //// age = 5000000; //// name = "no name"; // this(50000,"no name"); //자신의 다른 생성자 호출 // } // Person(int age){ // this(age,"no name"); // } // Person(int age, String name){ // this.age = age; // this.name = name; // } // // void view() { //메소드 (함수) // System.out.println(age +"살의 " +name); // } // public void setAge(int age) { // this.age =age; // } //} //class Main{ // public static void main(String[] args) { // Person a; //레퍼런스 변수 생성 // a = new Person(); //객체 생성 // a.setAge(50); //// a.age = 500; //// a.name = "원장님"; //// System.out.println(a.age +"살의 " +a.name); // // Person b = new Person(50); // 레퍼런스변수 + 객체 생성 // b.view(); // // Person c = new Person(5000,"윤건"); // c.view(); // } //} //class TV //{ // String name; // int year; // int inch; // TV(String name, int year, int inch) // { // this.name = name; // this.year = year; // this.inch = inch; // } // void show() // { // System.out.println(name + "에서 만든 " + year + "년형 " + inch + ""); // } //} //public class Main //{ // public static void main(String[] args) // { // TV myTV = new TV("LG", 2017, 32); // myTV.show(); // } //}
0
0
2
권현수
2022년 10월 18일
In 소스 코드 제출
//import java.util.*; //public class Main //{ // public static void main(String[] args) // { // Scanner t = new Scanner(System.in); // int map[][] = new int [100][100]; // int x = t.nextInt(); // int y = t.nextInt(); // // for(int i=0; i<x; i++) // { // for(int j=0; j<y; j++) // { // map[i][j] = 0; // } // } // // int data[][] = new int[10][4]; // int n = t.nextInt(); // for(int i=0; i<n; i++) // { // for(int j=0; j<4; j++) // { // data[i][j] = t.nextInt(); // } // } // // for(int i=0; i<n; i++) // { // if(data[i][1] == 1) // { // for(int j = 0; j<data[i][0]; j++) // { // map[ data[i][2]-1 + j] [ data[i][3]-1 ] = 1; // } // } // else if(data[i][1] == 0) // { // for(int j=0; j<data[i][0]; j++) // { // map[ data[i][2]-1] [ data[i][3]-1 + j] = 1; // } // } // } // // for(int i=0; i<x; i++) // { // for(int j=0; j<y; j++) // { // System.out.print(map[i][j]+" "); // } // System.out.println(); // } // } //} //import java.util.*; //public class Main //{ // public static void main(String[] args) // { // Scanner t = new Scanner(System.in); // int map[][] = new int [11][11]; // int x=2; // int y=2; // int first = 1; // for(int i = 1; i<=10; i++) // { // for(int j = 1; j<=10; j++) // { // map[i][j] = t.nextInt(); // } // } // // while(true) // { // if(first == 1) // { // if(map[x][y] == 2) // { // map[x][y]=9; // break; // } // else if(map[x][y] == 1) // { // break; // } // else if(map[x][y] == 0) // { // map[x][y] = 9; // first = 0; // } // } // else // { // if(map[x][y+1] == 0) // { // map[x][y+1] = 9; // y+=1; // continue; // } // else if(map[x][y+1] == 2) // { // map[x][y+1] = 9; // break; // } // else if(map[x+1][y] == 2) // { // map[x+1][y] = 9; // break; // } // else if(map[x][y+1] == 1) // { // if(map[x+1][y] == 1) // { // break; // } // else if(map[x+1][y] == 0) // { // map[x+1][y] = 9; // x+=1; // continue; // } // } // } // } // // for(int i=1; i<=10; i++) // { // for(int j=1; j<=10; j++) // { // System.out.print(map[i][j] + " "); // } // System.out.println(); // } // } //} //import java.util.*; //public class Main //{ // public static void main(String[] args) // { // Scanner t = new Scanner(System.in); // int map[][] = new int [20][20]; // int player[][] = new int [10][5]; // int bomb; // int mx = 1; // int px = 1; // int my = 1; // int py = 1; // for(int i=1; i<=10; i++) // { // for(int j=1; j<=10; j++) // { // map[i][j]=t.nextInt(); // } // } // for(int i=1; i<=10; i++) // { // for(int j=1; j<10; j++) // { // if(map[i][j] > 0) // { // bomb = map[i][j]+2; // py = 1; // my= 1; // px= 1; // mx= 1; // map[i][j] = -2; // for(int k=1; k<bomb; k++) // { // if(i-k >=0 && j-k>=0) // { // if(px == 1 && map[i+k][j] != -1) {map[i+k][j] = -2;} // else {px = 0;} // if(mx == 1 && map[i-k][j] != -1) {map[i-k][j] = -2;} // else {mx = 0;} // if(py == 1 && map[i][j+k] != -1) {map[i][j+k] = -2;} // else {py = 0;} // if(my == 1 && map[i][j-k] != -1) {map[i][j-k] = -2;} // else {my = 0;} // } // } // } // } // } ////폭탄 터트리기 끝 // // int n=t.nextInt(); // for(int i=1; i<=n; i++) // { // for(int j=0; j<2; j++) // { // player[i][j] = t.nextInt(); // } // } // for(int i=1; i<=n; i++) // { // if(map[ player[i][0] ][ player[i][1] ] == 0) // { // map[ player[i][0] ][ player[i][1] ] = i; // } // } // // for(int i=1; i<=10; i++) // { // for(int j=1; j<=10; j++) // { // System.out.print(map[i][j] + " "); // } // System.out.println(); // } // System.out.println("Character Information"); // for(int i=1; i<=n; i++) // { // if(map[ player[i][0] ][ player[i][1] ] == i) // { // System.out.println("player " + i + " survive"); // } // else // { // System.out.println("player " + i + " daed"); // } // } // } //}
0
0
1
권현수
2022년 10월 16일
In 소스 코드 제출
//import java.util.*; // //public class Main //{ // public static void main(String[] args) // { // Scanner t = new Scanner(System.in); // int a[][] = new int[11][11]; // for(int i=0; i<9; i++) // { // for(int j=0; j<9; j++) // { // a[i][j] = t.nextInt(); // } // } // int y = t.nextInt(); // int x = t.nextInt(); // int cnt = 0; // // // if(a[y-1][x-1]==0 && y-2>=0 && x-2>=0) // { // cnt+=a[y-2][x-2]+a[y-2][x-1]+a[y-2][x]; // cnt+=a[y-1][x-2]+a[y-1][x]; // cnt+=a[y][x-2]+a[y][x-1]+a[y][x]; // } // else if(a[y-1][x-1]==0 && x-2>=0&&y==1) // { // cnt+=a[y-1][x-2]+a[y-1][x]; // cnt+=a[y][x-2]+a[y][x-1]+a[y][x]; // } // else if(a[y-1][x-1]==0 && x==1 && y-2>=0) // { // cnt+=a[y-2][x-1]+a[y-2][x]; // cnt+=a[y-1][x]; // cnt+=a[y][x-1]+a[y][x]; // } // else if(a[y-1][x-1]==0 && x==1 && y==1) // { // cnt+=a[y-1][x]; // cnt+=a[y][x-1]+a[y][x]; // } // else if(a[y-1][x-1]==1) // { // cnt=-1; // } // // System.out.println(cnt); // } //}
0
0
2
권현수
2022년 8월 21일
In 소스 코드 제출
#include <stdio.h> #include <stdlib.h> int map[100][100]= {}; int main() { int n,m, sum=0,tsum=0,hsum=0,fsum=0; scanf("%d %d", &n,&m); for(int i=0; i<n; i++) { for(int j=0; j<n; j++) { scanf("%d", &map[i][j]); } } for(int i=0; i<n; i++) { for(int j=0; j<n; j++) { for(int k=0; k<=m; k++) { sum += map[i+k][j] + map[i-k][j] + map[i][j-k] + map[i][j+k]; tsum+= map[i+k][j+k]+map[i-k][j-k]+map[i+k][j-k]+map[i-k][j+k]; } sum-=map[i][j]*3; tsum-=map[i][j]*3; if(sum>tsum) { if(hsum<sum) { hsum=sum; } } else if(sum<tsum) { if(hsum<tsum) { hsum = tsum; } } sum=0; tsum=0; } } printf("%d", hsum); }
0
0
2
권현수
2022년 8월 18일
In 소스 코드 제출
//import java.util.*; //public class Main //{ // public static void main(String[] args) // { // Scanner t = new Scanner(System.in); // String str = t.nextLine(); // char[] b = str.toCharArray(); // // for(int i=0; i<b.length; i++) // { // if(b[i] == ' ') // { // continue; // } // else // { // System.out.print(b[i]); // } // } // } //} //import java.util.*; //public class Main //{ // public static void main(String[] args) { // Scanner t = new Scanner(System.in); // String str = t.nextLine(); // char[] b = str.toCharArray(); // char[] c = str.toCharArray(); // // for(int i=0; i<b.length; i++) // { // b[i]+=2; // c[i]*=7; // c[i]%=80; // c[i]+=48; // } // // System.out.println(b); // System.out.println(c); // } //} //import java.util.*; //public class Main //{ // public static void main(String[] args) // { // Scanner t = new Scanner(System.in); // String str = t.nextLine(); // char[] b = str.toCharArray(); // int a=0; // int c=0; // // for(int i=0; i<b.length; i++) // { // if(b[i] == '(') // { // a++; // } // else if(b[i] == ')') // { // c++; // } // } // System.out.printf("%d %d", a, c); // } //} //import java.util.*; //public class Main //{ // public static void main(String[] args) { // Scanner t = new Scanner(System.in); // String str = t.nextLine(); // char[] b = str.toCharArray(); // int a = 0; // int c = 0; // // for(int i=0; i<b.length; i++) // { // if(b[i]=='c' || b[i] == 'C') // { // a++; // if(b[i+1] == 'c'|| b[i+1] == 'C' ) // { // c++; // } // } // } // System.out.printf("%d\n%d", a,c); // } //} //import java.util.*; //public class Main //{ // public static void main(String[] args) // { // Scanner t = new Scanner(System.in); // String str = t.nextLine(); // char[] b = str.toCharArray(); // // for(int i=0; i<b.length; i++) // { // if(b[i] == 't') // { // System.out.print(i+1+" "); // } // } // } //} //import java.util.*; //public class Main //{ // public static void main(String[] args) { // Scanner t = new Scanner(System.in); // String str = t.nextLine(); // char[] b = str.toCharArray(); // int a=0; // // for(int i=0; i<b.length; i++) // { // if(b[i] == 'l' && b[i+1] == 'o' && b[i+2] == 'v' && b[i+3] == 'e') // { // a++; // } // } // System.out.println(a); // } //} //import java.util.*; //public class Main //{ // public static void main(String[] args) // { // Scanner t = new Scanner(System.in); // String str = t.nextLine(); // // if(str.equals("IOI")) // { // System.out.printf("IOI is the International Olympiad in Informatics."); // } // else // { // System.out.printf("I don't care."); // } // // } //} //import java.util.*; //public class Main //{ // public static void main(String[] args) // { // Scanner t = new Scanner(System.in); // String a = t.next(); // String b = t.next(); // // if(a.length()<b.length())System.out.println(a+" "+b); // else if (a.length() == b.length()) { // if(a.compareTo(b)> 0 )System.out.println(b+" "+a); // else System.out.println(a+" "+b); // }else System.out.println(b+" "+a); // } //} //import java.util.*; //public class Main //{ // public static void main(String[] args) // { // Scanner t = new Scanner(System.in); // String str = t.next(); // int sum=0; // // for(int i=0; i<str.length(); i++) // { // sum+=str.charAt(i)-'0'; // } // System.out.println(sum); // // if(sum%3 == 0) // { // System.out.printf("1"); // } // else // { // System.out.printf("0"); // } // } //} //import java.util.*; //public class Main //{ // public static void main(String[] args) // { // Scanner t = new Scanner(System.in); // String s1 = t.next(); // String s2 = t.next(); // String s3 = t.next(); // // int s11 = s1.length()-1; // int s22 = s2.length()-1; // int s33 = s3.length()-1; // if(s1.charAt(s11) == s2.charAt(0) && s2.charAt(s22) == s3.charAt(0) && s3.charAt(s33) == s1.charAt(0)) // { // System.out.println("good"); // return; // } // else // { // System.out.println("bad"); // return; // } // } //} //import java.util.*; //public class Main //{ // public static void main(String[] args) { // Scanner t = new Scanner(System.in); // String str = t.next(); // System.out.printf("welcome! %s", str); // } //} //1508 1509 1513 1525 1507 1505 //import java.util.*; //public class Main //{ // public static void main(String[] args) { // Scanner t = new Scanner(System.in); // int[][] a = new int[100][100]; // int n = t.nextInt(); // for(int i=0; i<n; i++) // { // a[i][0] = t.nextInt(); // } // // // // for(int i=0; i<n; i++) // { // for(int j=0; j<=i; j++) // { // a[i+1][j+1] = a[i+1][j] - a[i][j]; // } // } // // for(int i=0; i<n; i++) // { // for(int j=0; j<=i; j++) // { // System.out.print(a[i][j]+ " "); // } // System.out.println(); // } // } //} //import java.util.*; //public class Main //{ // public static void main(String[] args) // { // Scanner t = new Scanner(System.in); // int[][] board = new int[11][10]; // // for(int i=0; i<11; i++) // { // for(int j=0; j<10; j++) // { // board[i][j] = t.nextInt(); // } // } // // for(int i=0; i<10; i++) // { // if(board[10][i] == 1) // { // System.out.printf("%d ", i+1); // for(int j=9; j>=0; j--) // { // if(board[j][i] > 0) // { // System.out.println("crash"); // break; // } // else if(board[j][i]<0) // { // System.out.println("fall"); // break; // } // else if(j==0) // { // System.out.println("safe"); // break; // } // } // } // } // } //}
0
0
1
권현수
2022년 8월 16일
In 소스 코드 제출
//import java.util.*; //import java.util.Arrays; //public class Main //{ // public static void main(String[] args) { // Scanner t = new Scanner(System.in); // int f = t.nextInt(); // int c = t.nextInt(); // int cf = 0; // int arr[] = new int[f]; // for(int i=0; i<f; i++) // { // arr[i] = t.nextInt(); // } // Arrays.sort(arr); // for(int i=0; i<f; i++) // { // if(cf != c) {System.out.printf("%d ",arr[i]);} // else if(cf == c) // { // System.out.println(); // System.out.printf("%d ", arr[i]); // cf=0; // } // cf++; // } // } // // // } //import java.util.*; // //public class Main //{ // public static void main(String[] args) { // Scanner t = new Scanner(System.in); // int n = t.nextInt(); // int arr[] = new int[n]; // for(int i=0; i<n; i++) // { // arr[i] = t.nextInt(); // } // for(int i=0; i<n; i++) // { // System.out.printf("%d: ", i+1); // for(int j=0; j<n; j++) // { // if(i==j) // { // continue; // } // else // { // if(arr[i]>arr[j]) // { // System.out.printf("> "); // } // else if(arr[i]<arr[j]) // { // System.out.printf("< "); // } // else if(arr[i]==arr[j]) // { // System.out.printf("= "); // } // } // } // System.out.println(); // } // } //} /* import java.util.*; public class Main { public static void main(String[] args) { Scanner t = new Scanner(System.in); int a = t.nextInt(); int[] b = new int[a]; for (int i = 0; i < a; i++) { b[i] = t.nextInt(); } for (int i = 0; i < a; i++) { for (int j = i; j < a; j++) { System.out.print(b[j]+ " "); } for (int j = 0; j < i; j++) { System.out.print(b[j] + " "); } System.out.println(); } } } */ //import java.util.*; //public class Main //{ // public static void main(String[] args) // { // char arr[] = new char[50]; // String str = "hello world"; // // arr = str.toCharArray(); // // System.out.println(str); // // //str[10] (x) // //str.charAt(10) // //arr[10] // // String str1 = "hello"; // String str2 = "world"; // //if(str1.equals(str2)) (o) // //if(str1==str2) (x) // // //if(str1.charAt(2)=='a') (o) // } //} //import java.util.*; //public class Main //{ // public static void main(String[] args) // { // Scanner t = new Scanner(System.in); // String str; // str = t.nextLine(); // // for(int i=0; i<str.length(); i++) // { // System.out.printf("\'%c\'", str.charAt(i)); // System.out.println(); // } // } //} //import java.util.*; //public class Main //{ // public static void main(String[] args) { // Scanner t = new Scanner(System.in); // String str; // str = t.nextLine(); // System.out.println(str); // } //} //import java.util.*; //public class Main //{ // public static void main(String[] args) { // Scanner t = new Scanner(System.in); // String str; // str = t.nextLine(); // System.out.println(str); // } //} //import java.util.*; //public class Main //{ // public static void main(String[] args) { // Scanner t = new Scanner(System.in); // String str; // str = t.nextLine(); // System.out.println(str); // } //} //import java.util.*; //public class Main //{ // public static void main(String[] args) // { // Scanner t = new Scanner(System.in); // String str = t.nextLine(); // char[] b = str.toCharArray(); // for(int i=0; i<b.length; i++) // { // int x = (int)b[i]; // if('A' <= x && x<=90) // { // b[i]+=32; // } // else if(97<=x && x<=122) // { // b[i]-=32; // } // } // // for (int i = 0; i < b.length; i++) { // System.out.print(b[i]); // } // } //} //import java.util.*; //public class Main //{ // public static void main(String[] args) // { // Scanner t = new Scanner(System.in); // String str = t.nextLine(); // char[] b = str.toCharArray(); // if( b.length == 4&& b[0] == 'l' && b[1] == 'o' && b[2] == 'v' && b[3] == 'e') // { // System.out.println("I love you."); // } // } //} import java.util.*; public
0
0
1
권현수
2022년 8월 09일
In 소스 코드 제출
package kwonwknhsoo; //import java.util.*; //public class Main //{ // public static void main(String[] args) // { // Scanner t = new Scanner(System.in); // // int a = t.nextInt(); // int min = 1; // int max = a; // // for(int i=1; i<=a; i++) // { // for(int j=1; j<=a; j++) // { // if(i==1 || i==a || j==1 || j == a) // { // System.out.print("*"); // } // else if(min == j || max==j) // { // System.out.print("*"); // } // else // { // System.out.print(" "); // } // } // min++; // max--; // System.out.println(); // } // } //} //import java.util.*; // //public class Main //{ // public static void main(String[] args) // { // Scanner t = new Scanner(System.in); // // int n = t.nextInt(); // int arr[] = new int[n]; // int max = (n*(n+1))/2; // int sum=0; // for(int i=0; i<n-1; i++) // { // arr[i] = t.nextInt(); // } // // for(int i=0; i<n-1; i++) // { // sum +=arr[i]; // } // System.out.println(max - sum); // } //} //import java.util.*; // //public class Main //{ // public static void main(String[] args) // { // Scanner t = new Scanner(System.in); // int n = t.nextInt(); // int i=0,j=0; // int[] b = new int[500]; // // if(n == 0) System.out.println("0");//입력값이 0일때 // // while(n>0){ // 2진수변환 // b[i] = n%2; // n /=2; // i++; // } // // for (j = i-1; j >= 0; j--) { // System.out.print(b[j]); // } // } //} //import java.util.*; //import java.util.Arrays; // //public class Main //{ // public static void main(String[] args) // { // Scanner t = new Scanner(System.in); // int n = t.nextInt(); // int arr[] = new int[n]; // int a = t.nextInt(); // int j=0; // for(int i=0; i<n; i++) // { // arr[i] = t.nextInt(); // } // Arrays.sort(arr); // // for(int i : arr) // { // if(j!=a) // { // System.out.print(i+" "); // } // else if(j==a) // { // System.out.println(); // System.out.print(i+" "); // } // j++; // } // } //} //import java.util.*; // //public class Main //{ // public static void main(String[] args) // { // Scanner t = new Scanner(System.in); // int a = t.nextInt(); // int arr[] = new int[a]; // for(int i=0; i<a; i++) // { // arr[i] = t.nextInt(); // } // // for(int i=0; i<a; i++) // { // System.out.print(i+1+": "); // for(int j=0; i<a; j++) // { // if(i==j) // { // continue; // } // else if(arr[i]<arr[j]) // { // System.out.print("< "); // } // else if(arr[i]>arr[j]) // { // System.out.print("> "); // } // else if(arr[i]==arr[j]) // { // System.out.print("= "); // } // } // System.out.println(); // } // } //}
0
0
1
권현수
2022년 8월 07일
In 소스 코드 제출
//import java.util.Scanner; //public class Main //{ // public static void main(String[] args) // { // Scanner t = new Scanner(System.in); // int n = t.nextInt(); // // for(int i=0; i<n; i++) // { // for(int j=1; j<=n; j++) // if(i == 0 || i == n-1 || i!=0 && j==1 || i!=0 && j==n) // { // System.out.print("*"); // } // else // { // System.out.print(" "); // } // System.out.println(); // } // } //} //import java.util.Scanner; // //public class Main //{ // public static void main(String[] args) // { // Scanner t = new Scanner(System.in); // int n = t.nextInt(); // for (int i = 0; i <= n; i++) // { // if(i % 2 != 0 ) // { // for (int j = 0; j < i; j++) // { // System.out.print("*"); // } // System.out.println(); // } // else // { // for (int j = i+2; j <= n; j+=2) // { // System.out.print(" "); // } // } // } // } //} //import java.util.Scanner; //public class Main //{ // public static void main(String[] args) // { // Scanner t = new Scanner(System.in); // int n = t.nextInt(); // int min = 1; // int max = n; // for(int i=0; i<n; i++) // { // for(int j=1; j<=n; j++) // if(i == 0 || i == n-1 || i!=0 && j==1 || i!=0 && j==n) // { // System.out.print("*"); // } // else if (j==min || j==max || j==min && min==max) // { // System.out.print("*"); // } // else // { // System.out.print(" "); // } // min++; // max--; // System.out.println(); // } // } //} //import java.util.Scanner; // //public class Main //{ // public static void main(String[] args) // { // Scanner t = new Scanner(System.in); // int n= t.nextInt(); // int k = t.nextInt(); // // for (int i = 1; i <= n; i++) // { // for (int j = 1; j <= n; j++) // { // if(i==1||i==n||j==1||j==n) // { // System.out.print("*"); // } // else if(k == 1) // { // System.out.print("*"); // } // else if((i+j) % k == 1) // { // System.out.print("*"); // } // else // { // System.out.print(" "); // } // } // System.out.println(); // } // } //} //import java.util.*; // //public class Main { // public static void main(String[] args) { // Scanner t = new Scanner(System.in); // // int n = t.nextInt(); // int arr[] = new int[n]; // // for(int i=0; i<n; i++) { // arr[i] = t.nextInt(); // } // } //} import java.util.*; //public class Main //{ // public static void main(String[] args) // { // Scanner t =new Scanner(System.in); // // // int n = t.nextInt(); // int arr[] = new int[n]; // for(int i=0; i<n; i++) // { // arr[i] = t.nextInt(); // } // // for(int i=n-1; i>=0; i--) // { // System.out.print(arr[i]+" "); // } // // } // //} //import java.util.*; // //public class Main //{ // public static void main(String[] args) // { // Scanner t =new Scanner(System.in); // // // int n = t.nextInt(); // int arr[] = new int[n]; // for(int i=0; i<n; i++) // { // arr[i] = t.nextInt(); // } // // for(int i=n-1; i>=0; i--) // { // System.out.print(arr[i]+" "); // } // // } // //} //import java.util.*; // //public class Main //{ // public static void main(String[] args) // { // Scanner t = new Scanner(System.in); // int arr[] = new int[10]; // for(int i=0; i<10; i++) // { // arr[i] = t.nextInt(); // } // int n = t.nextInt(); // // System.out.println(arr[n-1]); // } //}
0
0
1
권현수
2022년 7월 31일
In 소스 코드 제출
//import java.util.Scanner; // //public class Main //{ // public static void main(String[] args) // { // Scanner t = new Scanner(System.in); // // int a = t.nextInt(); // int b = t.nextInt(); // int sum = 0; // // for(int i=a; i<=b; i++) // { // if(i%2==1) // { // sum = sum+i; // } // else if(i%2==0) // { // sum = sum-i; // } // } // System.out.println(sum); // } //} //import java.util.Scanner; //public class Main //{ // public static void main(String[] args) // { // Scanner t = new Scanner(System.in); // // int a = t.nextInt(); // int b = t.nextInt(); // int sum=0; // // for(int i=a; i<=b; i++) // { // if(i%2==1)//홀수? // { // System.out.print("+"+i); // sum = sum+i; // } // else if(i%2==0)//짝수? // { // System.out.print("-"+i); // sum = sum-i; // } // } // System.out.print("="+sum); // } //} //import java.util.Scanner; //public class Main //{ // public static void main(String[] args) // { // Scanner t = new Scanner(System.in); // // int a = t.nextInt(); // int b = t.nextInt(); // int sum = 0; // // if(a%2==0) // { // System.out.print("-"+a); // sum = sum-a; // } // else if(a%2==1) // { // System.out.print(a); // sum = sum+a; // } // // for(int i=a+1; i<=b; i++) // { // if(i%2==0) // { // System.out.print("-"+i); // sum = sum-i; // } // else if(i%2==1) // { // System.out.print("+"+i); // sum = sum+i; // } // } // System.out.print("="+sum); // } //} //import java.util.Scanner; // //public class Main //{ // public static void main(String[] args) // { // Scanner t = new Scanner(System.in); // // int a = t.nextInt(); // int b = t.nextInt(); // int c = t.nextInt(); // int d = t.nextInt(); // // for(int i=1; i<d; i++) // { // a = a * b + c; // } // System.out.println(a); // } //} //import java.util.Scanner; //public class Main //{ // public static void main(String[] args) // { // Scanner t = new Scanner(System.in); // // int a = t.nextInt(); // int b=0; // int c=0; // if(a==2) // { // System.out.println("1 1"); // return; // } // for(int i=0; i<a; i++) // { // if(i*i >= a)//i의 제곱이 a값을 넘어가는 경우 // { // b = a - ((i-1) * (i-1)); // c = i-1; // break; // } // } // System.out.println(b+" "+c); // } //} //import java.util.Scanner; //public class Main //{ // public static void main(String[] args) // { // Scanner t = new Scanner(System.in); // // int a = t.nextInt(); // // for(int i=0; i<a; i++) // { // for(int j=0; j<=i; j++) // { // System.out.print("*"); // } // System.out.println(); // } // } //} //import java.util.Scanner; //public class Main //{ // public static void main(String[] args) // { // Scanner t = new Scanner(System.in); // // int a = t.nextInt(); // // for(int i = a; i > 0; i--) // { // for(int j = a; j > i; j--) // { // System.out.print(" "); // } // for(int k = 0; k < i; k++) // { // System.out.print("*"); // } // System.out.println(); // } // } //} //import java.util.Scanner; //public class Main //{ // public static void main(String[] args) // { // Scanner t = new Scanner(System.in); // // int a = t.nextInt(); // // for(int i=0; i<a; i++) // { // for(int k=a-1; k>i; k--) // { // System.out.print(" "); // } // for(int j=0; j<a; j++) // { // System.out.print("*"); // } // System.out.println(); // } // } //} //import java.util.Scanner; //public class Main //{ // public static void main(String[] args) // { // Scanner t = new Scanner(System.in); // // int a = t.nextInt(); // // for(int i = 0; i<a; i++) // { // // } // } //}
0
0
1
권현수
2022년 7월 17일
In 소스 코드 제출
//import java.util.Scanner; // //public class Main { // public static void main(String[] args) { // Scanner t = new Scanner(System.in); // // int b = t.nextInt(); // int a = t.nextInt(); // // if(a-30 < 0) // { // if(b-1 < 0) // { // b=23; // } // else // { // b = b-1; // } // a = a+30; // System.out.println(b+" "+a); // } // else if(a - 30 >= 0) // { // a = a-30; // // System.out.println(b+" "+a); // } // } //} //import java.util.Scanner; // //public class Main{ // public static void main(String[] args) { // Scanner t = new Scanner(System.in); // // int x = t.nextInt(); // int a = x/10; //10자릿수 // int b = x%10; //1자릿수 // // int sum = (b*10 + a)*2; // if(sum>100) // { // sum = sum-100; // } // System.out.println(sum); // if(sum>50) // { // System.out.println("OH MY GOD"); // } // else { // System.out.println("GOOD"); // } // } //} //import java.util.Scanner; // //public class Main //{ // public static void main(String[] args) // { // Scanner t = new Scanner(System.in); // // double a = t.nextDouble(); // double b = t.nextDouble(); // // if(a<150)//표준 몸무게 구하기 // { // a = a-100; // } // else if(a>=150 && a<160) // { // a = (a-150)/2 +50; // } // else if(a>=160) // { // a = (a-100)*0.9; // } //표준 몸무게 구하기 끝 // // double sum = (b-a)*100 / a; //비만도 구하기 // if(sum<=10.0)//비만도 등급 판정 // { // System.out.println("정상"); // } // else if(10.0<sum && sum<=20.0) // { // System.out.println("과체중"); // } // else if(20.0<sum) // { // System.out.println("비만");//비만도 등급 판정 끝, 코드 끝 // } // } //} //import java.util.Scanner; // //public class Main //{ // public static void main(String[] args) { // Scanner t = new Scanner(System.in); // // int a = t.nextInt(); // int b = t.nextInt(); // int c = t.nextInt(); // // if(a>170) // { // if(b>170) // { // if(c>170) // { // System.out.println("PASS "); // } // else // { // System.out.println("CRASH "+c); // } // } // else // { // System.out.println("CRASH "+b); // } // } // else // { // System.out.println("CRASH "+a); // } // } //} //import java.util.Scanner; // //public class Main //{ // public static void main(String[] args) // { // Scanner t = new Scanner(System.in); // // int a = t.nextInt(); // // for(int i=1; i<=a; i++) // { // if(a%i == 0) // { // System.out.print(i+" "); // } // } // } //} //import java.util.Scanner; // //public class Main //{ // public static void main(String[] args) { // Scanner t = new Scanner(System.in); // // int a = t.nextInt(); // int b=0; // if(a==1 || a==2) // { // System.out.println("prime"); // return; // } // for(int i=1; i<=a; i++) // { // if(a%i == 0) // { // b++; // } // } // if(b==2) // { // System.out.println("prime"); // } // else // { // System.out.println("not prime"); // } // } //} //import java.util.Scanner; // //public class Main //{ // public static void main(String[] args) // { // Scanner t = new Scanner(System.in); // // int a = t.nextInt(); // int b = t.nextInt(); // int c = a; // if(b == 0) // { // System.out.println("1"); // return; // } // if(b == 1) // { // System.out.println(a); // return; // } // for(int i=0; i<b-1; i++) // { // a = a*c; // } // System.out.println(a); // } //} //import java.util.Scanner; // //public class Main //{ // public static void main(String[] args) // { // Scanner t = new Scanner(System.in); // // int a = t.nextInt(); // int sum=1; // for(int i=1; i<=a; i++) // { // sum = sum*i; // } // System.out.println(sum); // } //} //import java.util.Scanner; // //public class Main //{ // public static void main(String[] args) // { // Scanner t = new Scanner(System.in); // // int a=t.nextInt(); // for(int i=0; i<a; i++) // { // // } // } //}
0
0
1
권현수
2022년 7월 10일
In 소스 코드 제출
//public class Main { // public static void main(String[] args) { // System.out.println("\"C:\\Download\\hello.cpp\""); // } //} //import java.util.Scanner; // //public class Main { // public static void main(String[] args) { // Scanner t = new Scanner(System.in); // // int x = t.nextInt(); // int y = t.nextInt(); // double a = t.nextDouble(); // // char p = t.next().charAt(0); // String v = t.next(); // System.out.println("%.2f",); // // System.out.println(x+y); // } //} //import java.util.Scanner; // //public class Main{ // public static void main(String[] args) { // Scanner t = new Scanner(System.in); // // int x =t.nextInt(); // // System.out.println(x); // } //} //import java.util.Scanner; // //public class Main{ // public static void main(String[] args) { // Scanner t = new Scanner(System.in); // // char p = t.next().charAt(0); // // System.out.println(p); // } //} //import java.util.Scanner; // //public class Main{ // public static void main(String[] args) { // Scanner t = new Scanner(System.in); // // double a = t.nextDouble(); // // System.out.printf("%.6f", a); // } //} //import java.util.Scanner; // //public class Main{ // public static void main(String[] args) { // Scanner t = new Scanner(System.in); // // int x = t.nextInt(); // int y = t.nextInt(); // // System.out.println(x+" "+y); // } //} //import java.util.Scanner; // //public class Main{ // public static void main(String[] args) { // Scanner t = new Scanner(System.in); // // char a = t.next().charAt(0); // char b = t.next().charAt(0); // // System.out.println(b+" "+a); // } //} //import java.util.Scanner; // //public class Main{ // public static void main(String[] args) { // Scanner t = new Scanner(System.in); // // double a = t.nextDouble(); // // System.out.printf("%.2f",a); // } //} //import java.util.Scanner; // //public class Main{ // public static void main(String[] atgs) { // Scanner t = new Scanner(System.in); // // int a = t.nextInt(); // // System.out.println(a+" "+a+" "+a); // } //} //import java.util.Scanner; // //public class Main{ // public static void main(String[] args) { // Scanner t = new Scanner(System.in); // // char a = t.next().charAt(0); // int sum = (int)a; // // System.out.println(sum); // } //} //import java.util.Scanner; // //public class Main{ // public static void main(String[] args) { // Scanner t = new Scanner(System.in); // // int a = t.nextInt(); // char sum = (char)a; // // System.out.println(sum); // } //} //import java.util.Scanner; // //public class Main{ // public static void main(String[] args) { // Scanner t = new Scanner(System.in); // // long a = t.nextLong(); // long b = t.nextLong(); // // System.out.println(a+b); // } //} //import java.util.Scanner; // //public class Main{ // public static void main(String[] args) { // Scanner t = new Scanner(System.in); // // long a = t.nextLong(); // long b = t.nextLong(); // // System.out.println(a+b); // } //} //import java.util.Scanner; // //public class Main{ // public static void main(String[] args) { // Scanner t = new Scanner(System.in); // // int a = t.nextInt(); // // System.out.println(a*-1); // } //} //import java.util.Scanner; // //public class Main{ // public static void main(String[] args) { // Scanner t = new Scanner(System.in); // // char a = t.next().charAt(0); // int b = (int)a; // b=b+1; // char sum = (char)b; // // System.out.println(sum); // } //} //import java.util.Scanner; // //public class Main{ // public static void main(String[] args) { // Scanner t = new Scanner(System.in); // // String str = t.next(); // System.out.println(str); // //// String []v = str.split(":"); //// System.out.println(v[0] +" " + v[1]); // } //} //import java.util.Scanner; // //public class Main{ // public static void main(String[] args) { // Scanner t = new Scanner(System.in); // // String str = t.next(); // String []v =str.split("\\."); // // int a = Integer.valueOf(v[0]); // int b = Integer.valueOf(v[1]); // int c = Integer.valueOf(v[2]); // // System.out.printf("%04d.%02d.%02d", a,b,c); // } //} //import java.util.Scanner; // //public class Main{ // public static void main(String[] args) { // Scanner t = new Scanner(System.in); // // int a = t.nextInt(); // int b = t.nextInt(); // // System.out.println(a/b); // } //} //import java.util.Scanner; // //public class Main{ // public static void main(String[] args) { // Scanner t = new Scanner(System.in); // // int a = t.nextInt(); // int b = t.nextInt(); // // System.out.println(a%b); // } //} //import java.util.Scanner; // //public class Main{ // public static void main(String[] args) { // Scanner t = new Scanner(System.in); // // long a = t.nextLong(); // // System.out.println(++a); // } //} //import java.util.Scanner; // //public class Main{ // public static void main(String[] args) { // Scanner t = new Scanner(System.in); // // int a = t.nextInt(); // int b = t.nextInt(); // // System.out.println(a+b); // System.out.println(a-b); // System.out.println(a*b); // System.out.println(a/b); // System.out.println(a%b); // System.out.printf("%.2f",(float)a/b); // } //} //import java.util.Scanner; // //public class Main{ // public static void main(String[] args) { // Scanner t = new Scanner(System.in); // // int a = t.nextInt(); // int b = t.nextInt(); // int c = t.nextInt(); // // int plus = a+b+c; // // System.out.println(plus); // System.out.printf("%.1f", (float)plus/3); // } //}
0
0
3
권현수
2022년 5월 29일
In 소스 코드 제출
#include <stdio.h> #include <stdlib.h> #include <math.h> /*int main() { long long int n, m; scanf("%lld%lld", &n, &m); long long int arr[31] = {0}; //30회 안에 해결 long long int l = 1; arr[0] = n; arr[1] = (n * n)%1000000007; for(int i=2;i<30;i++){ arr[i] = (arr[i-1] * arr[i-1])%1000000007; } int count = 0; while(m!=0){ if(m%2==1){ l = (l * arr[count])%1000000007; } count++; m = m/2; } printf("%lld",l); return 0; }*/ /*int main() { int n,i,sum=0; scanf("%d", &n); for(i=1; i<n+1; i++) { if(n%i==0) { sum = sum+i; } } printf("%d ", sum); }*/ char s[7]; int a[7]; int main (void) { int n=0,m = 1, b = 0, d = 0, max = 0; scanf("0.%s", s); for(int i = 0; s[i] != NULL; i++) { if(s[i] >= 48 && s[i] <= 57) a[i] = s[i] - 48; n++; } for(int i = n-1; i >= 0; i--) { d = 1; for(int j = 0;j < i; j++) d *= 10; d *= a[n-1-i]; b += d; } for(int i = 0;i < n; i++) m *= 10; max = b; if(max < m) max = m; for(int j= 0; j < 5; j++) { for(int i = 1; i <= max; i++) { if((!(b % i)) && (!(m % i))) { b /= i, m /= i; } } } printf("%d %d", b, m); return 0; }
0
0
1
권현수
2022년 5월 08일
In 소스 코드 제출
#include <stdio.h> #include <stdlib.h> #include <string.h> /*int main() { int n,MF[2] = {0,0}; char a[150][100], *p; scanf("%d", &n); for(int i=0; i<n; i++) { scanf("%s", a[i]); } for(int i=0; i<n; i++) { p = strchr(a[i], ','); if(strncmp(p+1, "M",1)==0) { MF[0]++; } else { MF[1]++; } } printf("%d\n%d", MF[0], MF[1]); }*/ typedef struct person { char n; char g; int a; } person; int main() { int n,sum=0; char s[150][100]={}, *p; scanf("%d", &n); person *list = malloc(sizeof(person) * n); for(int i=0; i<n; i++) { scanf("%s", s[i]); } for(int i=0; i<n; i++) { p = strtok(s[i], ","); strcpy(list[i].n, p); p = strtok(s[i],","); strcpy(list[i].g, p); p = strtok(s[i],","); list[i].a = atoi(p); sum+=list[i].a; } free(list); printf("%.2f",(double)sum/n); }
0
0
2
권현수
2022년 4월 17일
In 소스 코드 제출
#include<stdio.h> /*int f(int a[], int s, int i){ int low = 0; int high = s - 1; int mid; while (low <= high) { mid = (low + high) / 2; if (a[mid] == i) { return mid; } else if (i > a[mid]) { low = mid + 1; } else if (i < a[mid]){ high = mid - 1; } } return -1; } int main() { int n = 0; int num1[1000] = { 0 }; int num2[1000] = { 0 }; int m = 0; scanf(" %d", &n); for (int i = 0; i < n; i++) scanf(" %d", &num1[i]); scanf(" %d", &m); for (int i = 0; i < m; i++) scanf(" %d", &num2[i]); for (int i = 0; i < m; i++) { int t = f(num1, n, num2[i]); if (t > -1) { printf("%d " ,t+1); } else { printf("%d " , t); } } } int main() { int n,num=0; scanf("%d", &n); for(int i=0; i<n; i++) for(int j=0; j<n; j++) for(int k=0; k<n; k++) if(i<=j && j<=k && i+j>k && i+j+k ==n) num++; printf("%d", num); }*/ int main() { int a[1000][2] = {}; int n,m,s=0,d=0; scanf("%d %d",&n,&m); for(int i=0; i<m; i++) { scanf("%d %d", &a[i][0], &a[i][1]); } for(int i=0; i<m; i++) { if(a[i][0] == a[i+1][0]) s++; } }
0
0
1
권현수
2022년 3월 30일
In 소스 코드 제출
#include <stdio.h> #include <stdlib.h> /*int main() { int n,m; //보드 크기 int c,h; //체크무늬 크기 int s,f,i,j,d,g; scanf("%d %d", &n, &m); scanf("%d %d", &c, &h); d=(c*n); g=(h*m); for(i=0; i<d; i++) { for(j=0; j<g; j++) { s=(i/c); f=(j/h); if((s+f) % 2 == 0) printf("X"); else printf("."); } printf("\n"); } }*/ /*int main() { char a[3][3] = { "*x*", " xx", "* *" }; int num; scanf("%d", &num); for(int i=0; i<3; i++) for(int x=0; x<num; x++, puts(" ")) for(int j=0; j<3; j++) for(int y=0; y<num; y++) printf("%c", a[i][j]); }*/
0
0
1

권현수

더보기
bottom of page