package com.huawei.unsuccessed;

import java.util.Arrays;  
import java.util.Scanner;  
  
class 合唱队 {  
    private static int[] beautifulScore;  
    private static int num;  
    private static String[] datas= null;  
    public static void main(String[] args) {  
        @SuppressWarnings("resource")  
        Scanner sc=new Scanner(System.in);  
        num=sc.nextInt();  
        sc.nextLine();  
        datas=new String[num];  
        for(int i=0;i<num;i++){  
            datas[i]=sc.nextLine();  
        }  
        int[] times=new int[26];  
        beautifulScore=new int[num];  
          
        for(int i=0;i<num;i++){  
            for (int k = 0; k < 26; k++) {  
                times[k]=0;  
            }  
            datas[i].toLowerCase();  
            for(int j=0;j<datas[i].length();j++){  
                times[datas[i].charAt(j)-97]++;  
            }  
            Arrays.sort(times);  
            for(int j=25;j>=0&&times[j]!=0;j--){  
                beautifulScore[i]+=(times[j]*(1+j));  
            }  
        }  
        for (int i = 0; i <num; i++) {  
            System.out.println(beautifulScore[i]);  
        }  
    }   
} 
@@ -99,126 +99,8 @@
 %E5%94%B1%E9%98%9F %7B
-  %0A    private static int%5B%5D beautifulScore;  %0A    private static int num;  %0A    private static String%5B%5D datas= null;  
 %0A   
@@ -144,913 +144,13 @@
 s) %7B
-  
 %0A    
-    @SuppressWarnings(%22resource%22)  %0A        Scanner sc=new Scanner(System.in);  %0A        num=sc.nextInt();  %0A        sc.nextLine();  %0A        datas=new String%5Bnum%5D;  %0A        for(int i=0;i%3Cnum;i++)%7B  %0A            datas%5Bi%5D=sc.nextLine();  %0A        %7D  %0A        int%5B%5D times=new int%5B26%5D;  %0A        beautifulScore=new int%5Bnum%5D;  %0A          %0A        for(int i=0;i%3Cnum;i++)%7B  %0A            for (int k = 0; k %3C 26; k++) %7B  %0A                times%5Bk%5D=0;  %0A            %7D  %0A            datas%5Bi%5D.toLowerCase();  %0A            for(int j=0;j%3Cdatas%5Bi%5D.length();j++)%7B  %0A                times%5Bdatas%5Bi%5D.charAt(j)-97%5D++;  %0A            %7D  %0A            Arrays.sort(times);  %0A            for(int j=25;j%3E=0&&times%5Bj%5D!=0;j--)%7B  %0A                beautifulScore%5Bi%5D+=(times%5Bj%5D*(1+j));  %0A            %7D  %0A        %7D  %0A        for (int i = 0; i %3Cnum; i++) %7B  %0A            System.out.println(beautifulScore%5Bi%5D);  %0A        %7D  %0A    %7D   
+%7D
 %0A%7D 

edit 合唱队.java