Java
[알고리즘/Java] String(문자열) - 문장 속 단어
방법 1. split() import java.util.Scanner; public class Main { public String solution(String str){ String answer = ""; int m = Integer.MIN_VALUE; String[] s = str.split(" "); for (String x : s) { int len = x.length(); if (len > m) { m = len; answer = x; } } return answer; } public static void main(String[] args) { Main T = new Main(); Scanner kb = new Scanner(System.in); String str = kb.nextLine();..
2022. 7. 18. 23:48