반응형

JAVA/알고리즘

    더블링크드 리스트 구현하기

    123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138package java8; public class Node { public Node next; public Node prev; private String value;..

    백준 1924 - 요일 맞추기

    12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879import java.util.Scanner; @SuppressWarnings("resource")public class Main { enum YOIL { MON, TUE, WED, THU, FRI, SAT, SUN } public static void main(String args[]) { Scanner sc = new Scanner(System.in); int x = sc.nextInt(); int y = sc.nextInt(); if (..

    백준 2839 - 설탕 배달

    1234567891011121314151617181920212223242526import java.util.Scanner; public class Main { public static void main(String args[]) { int n = new Scanner(System.in).nextInt(); int three = 0, int five = n / 5; int n %= 5; while (five >= 0) { if (n % 3 == 0) { three = n / 3; n %= 3; break; } five--; n += 5; } if (n==0) { System.out.println(five + three); } else { System.out.println(-1); } }}Colored by..

    선택정렬, 버블정렬, 삽입정렬 예제

    선택정렬 for(int i = 0; i

반응형