日期:2014-05-20  浏览次数:20786 次

简单 取消数组重复元素 的问题?急急急!!!
下面是两个数组,UserName()       和       Score()    
    现在要把每个用户的的分之和       给每一位用户,    
    即重新生成两个新的数组,    
    比如结果因该是:    
                                xing       共得分       xxx    
                                xingworld       共得分       xxx    
                                Richardmax       得分       xxx    
     
    用尽量简练的语言怎么做,谢谢!  

二个数组别为:
UserName= "xing,       xingworld,       xingworld,       xingworld,       xing,       xing,       xing,       xing,       xing,       xing,       xing,       xing,       xing,       xing,       xing,       xing,       xing,       xing,       xing,       xing,       xing,       xing,       xing,       Richardmax,       xing,       xing,       xing,       xing,       xing,       Richardmax,       Richardmax,       Richardmax,       Richardmax,       Richardmax,       Richardmax,       Richardmax "    
     
    WinScore= "1,       2,       3,       4,       5,       6,       7,       8,       9,       10,       11,       12,       13,       14,       15,       16,       17,       18,       19,       20,       21,       22,       23,       24,       25,       26,       27,       28,       29,       30,       31,       32,       33,       34,       35,       36 "

用java类来实现或javascript都可?

------解决方案--------------------
HashtableTest.java
===================================
import java.util.Enumeration;
import java.util.Hashtable;

public class HashtableTest {
public HashtableTest() {

}

public static void main(String[] args){
String UserName= "xing,xingworld,xingworld,xingworld,xing,xing,xing,xing,xing,xing,xing,xing,xing,xing,xing,xing,xing,xing,xing,xing,xing,xing,xing,Richardmax,xing,xing,xing,xing,xing,Richardmax,Richardmax,Richardmax,Richardmax,Richardmax,Richardmax,Richardmax ";
String WinScore= "1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36 ";
//先将字符串分割,放到数组里去