Banner

My Tech Blog (๊ตฌํ•˜๊ธฐ)

์˜ค๋Š˜์˜ ๋ช…์–ธ
" ๊ถํ•์€ ์˜ํ˜ผ๊ณผ ์ •์‹ ์„ ๋‚ณ๊ณ , ๋ถˆํ–‰์€ ์œ„๋Œ€ํ•œ ์ธ๋ฌผ์„ ๋‚ณ๋Š”๋‹ค. "
- ๋น…ํ† ๋ฅด ์œ„๊ณ  (์ž‘๊ฐ€, <๋ ˆ๋ฏธ์ œ๋ผ๋ธ”>์˜ ์ €์ž)
โœ… ๋ฌธ์ œโœ… ์ฝ”๋“œpublic class bonus02 { public static void main(String[] args) { System.out.println(getMiddle("123456789")); } public static String getMiddle(String wrd) { int center = wrd.length() / 2 + 1; String result; if (wrd.length() % 2 == 0) { result = wrd.substring(center - 2, center); } else { result = wrd.substring(center - 1, center); } return result; }} 1. getMiddle ๋ฉ”์†Œ๋“œ๋Š” ๋ฌธ์ž์—ด์„ ์ž…๋ ฅ์œผ๋กœ ..
โœ… ๋ฌธ์ œ์ž…๋ ฅ๋œ ๋ฌธ์žฅ์— ํฌํ•จ๋œ ์•ŒํŒŒ๋ฒณ์˜ ๋นˆ๋„๋ฅผ ๋Œ€์†Œ๋ฌธ์ž ๊ตฌ๋ณ„์—†์ด ๊ตฌํ•˜๋Š” ํ”„๋กœ๊ทธ๋žจ์„ ์ž‘์„ฑํ•˜์‹œ์˜ค. โœ… ์ฝ”๋“œimport java.util.Scanner;public class Main { public static void main(String[] args) { System.out.println("===== ์•ŒํŒŒ๋ฒณ ๋นˆ๋„์ˆ˜ ๊ตฌํ•˜๊ธฐ ====="); System.out.println("์ž…๋ ฅ >> "); Scanner sc = new Scanner(System.in); int[] result = new int[26]; String inPut = sc.nextLine().replaceAll(" ", ""); System.out.println(inPut); String outPut = inPut.toLowerC..
์ƒ๋‹จ์œผ๋กœ