분류 전체보기 59

열혈 C++ 프로그래밍 클래스 정의 문제

문제 04-3-2번 명함을 의미하는 NameCard 클래스 정의 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 #include #include using namespace std; namespace COMP_POS { enum { CLERK, SENIOR, ASSIST, MANAGER }; void ShowPositionInfo(int pos) { switch (pos) { case CLERK: cout

백준 11650번 (좌표 정렬하기) 자바 Java11

문제 : 좌표 정렬하기 시간 제한 : 1 sec 메모리 제한 : 256 MB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 import java.util.*; class Point implements Comparator{ int xpos; int ypos; Point(){ } Point(int x, int y){ this.xpos = x; this.ypos = y; } public int compare(Point o1, Point o2) { // TODO Auto-generated method stub if(o1.xpos==o2.xpos) { return o1.ypos-o2.ypo..

백준 1271번 (엄청난 부자2) 자바 Java11

문제 : 엄청난 부자2 시간 제한 : 2 sec 메모리 제한 : 128 MB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 import java.util.*; import java.math.*; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); String str = scan.nextLine(); String[] temp = str.split(" "); BigInteger m = new BigInteger(temp[0]); BigInteger n = new BigInteger(temp[1]); System.out.println(m.divide(n)); Syst..

백준 2609번 (최대공약수와 최소공배수) 자바 Java11

문제 : 최대공약수와 최소공배수 시간 제한 : 1 sec 메모리 제한 : 128 MB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a,b; a = sc.nextInt(); b = sc.nextInt(); int result = getResult(a,b); System.out.println(result); System.out.println(getResult2(a,b,result)); } public static i..