10 条题解

  • 0
    @ 2024-4-7 12:06:07
    import java.util.Scanner;
    
    public class Main {
    	public static void main(String[] args) {
    		Scanner sc = new Scanner(System.in);
    		int idx = sc.nextInt();
    		sc.nextLine(); // 读掉换行符防止影响s字符串的读取
    		String s = sc.nextLine();
    		sc.close();
    		String[] st = s.split(" ");
    		int sum = 0;
    		for (int i = 0; i < st.length; i++) {
    			sum += st[i].length();
    		}
    		System.out.println(sum);
    	}
    }
    

    信息

    ID
    12
    时间
    1000ms
    内存
    256MiB
    难度
    6
    标签
    递交数
    1634
    已通过
    442
    上传者