解题思路:
注意事项:
参考代码:
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s = sc.nextLine(); String[] s1 = s.split(" ");//通过空格把字符分开 int max = 0, t = 0; for (int i = 0; i < s1.length; i++) { if (max < s1[i].length()) { max = s1[i].length(); t = i; } } System.out.println(s1[t]); } }
0.0分
1 人评分