回答編集履歴

1

コードのデバッグ

2017/01/12 04:07

投稿

seastar3
seastar3

スコア2285

test CHANGED
@@ -24,13 +24,9 @@
24
24
 
25
25
 
26
26
 
27
- // 文字列ビルダーオブジェクトを用意
28
-
29
- StringBuilder builder = new StringBuilder();
30
-
31
27
  // 会場IDのハッシュ(連想配列)を用意
32
28
 
33
- HashMap<String,int> venueIdMap = new venueMap<String,int>();
29
+ HashMap<String,Integer> venueIdMap = new venueMap<String,Integer>();
34
30
 
35
31
 
36
32
 
@@ -68,7 +64,7 @@
68
64
 
69
65
  String strData = reader.readLine();
70
66
 
71
- String[] array;
67
+ String[] strItem;
72
68
 
73
69
  int userId, venueId, star;
74
70
 
@@ -76,15 +72,13 @@
76
72
 
77
73
  while (strData != null){
78
74
 
79
- builder.append(string + System.getProperty("line.separator"));
80
-
81
75
  strData = reader.readLine();
82
76
 
83
- array = strData.split(" ");
77
+ strItem = strData.split(" ");
84
78
 
85
- if (userIdMap.containsKey(strData[0])){
79
+ if (userIdMap.containsKey(strItem[0])){
86
80
 
87
- userId = userIdMap.containsKey(strData[0]);
81
+ userId = userIdMap.containsKey(strItem[0]);
88
82
 
89
83
  }else{
90
84
 
@@ -94,9 +88,9 @@
94
88
 
95
89
 
96
90
 
97
- if (venueIdMap.containsKey(strData[1])){
91
+ if (venueIdMap.containsKey(strItem[1])){
98
92
 
99
- venueId = venueIdMap.containsKey(strData[1]);
93
+ venueId = venueIdMap.containsKey(strItem[1]);
100
94
 
101
95
  }else{
102
96
 
@@ -106,7 +100,7 @@
106
100
 
107
101
 
108
102
 
109
- star = strData[2];
103
+ star = sstrItem[2];
110
104
 
111
105
  System.out.println(userId + " " + venueId + " " + star);
112
106