输出Map数据

输出Map数据

 

public static void printMapDType0(Map<String,Integer> D_type) {
    
    System.out.print("[");
    
    for(int m=1;m<totalDay;m++) {
        String indexKey = ""+(m);
        
        if(D_type.containsKey(indexKey)) {
            int indexValue = D_type.get(indexKey);
            System.out.print(indexValue+"");
        }else {
            System.out.print("0");
        }
        
        if(m<totalDay-1) {
            System.out.print(",");
        }
    }
    
    System.out.print("]\n");
    
}

 

 

[7,9,8,8,7,7,3,7,9,9,7,5,6,6,2,6,6,5,9,5,7,7,7,6,6,5,6,6,6,8,7,7,10,8,7,9,6,8,6,4,9,7,5,5,9,6,7,7,7,6,6,9,5,8,9,9,4,6,3,6,9,5,4,10,6,6,8,5,7,7,8,6,6,5,5,4,10,5,5,7,8,6,9,7,11,7,7,12,7,10,10,7,6,6,10,2,4,7,8,8,6,4,8,6,8,3,8,8,9,7,6,5,6,10,10,8,6,3,7,6,5,10,10,8,7,6,6,6,7,8,7,8,6,9,8,6,6,5,4,9,5,7,1,9,5,8,9,8,7,7,10,8,5,5,7,9,6,8,4,8,9,9,4,5,5,3,3,5,6,7,9,8,6,8,6,5,8,8,6,9,8,10,4,9,7,9,4,3,6,7,9,8,8,3,6,7,5,8,8,9,10,7,9,7,8,7,6,6,4,9,10,8,5,10,7,7,7,6,3,5,5,7,9,6,8,8,8,7,5,6,7,7,8,6,6,7,7,6,6,8,6,8,6,5,7,8,7,4,4,8,5,6,3,3,5,9,8,7,7,8,8,8,3,8,6,4,7,12,6,7,9,8,9,9,5,8,6,8,5,6,5,6,8,10,8,7,7,7,8,7,6,5,7,8,5,9,9,8,7,10,8,9,9,8,8,5,6,6,7,6,6,9,9,6,9,7,5,5,6,8,6,4,9,6,8,6,8,7,5,11,7,7,7,9,6,7,11,6,10,8,6,4,6,7,6,7,7,6,12,9,7,5,8,6,6,9,8,4,7,7,11,8,8,4]

 

 

 

 

 

############################################

posted @ 2021-12-16 09:02  西北逍遥  阅读(279)  评论(0编辑  收藏  举报