<span style="color:#333333;font-family:gulim, Dotum, Helvetica, AppleGothic, sans-serif;">map.put을 이용해 변수들을 저장하고 entry를 이용해 최소값을 뽑습니다</span> <div style="font-family:gulim, Dotum, Helvetica, AppleGothic, sans-serif;color:#333333;"><br></div> <div style="font-family:gulim, Dotum, Helvetica, AppleGothic, sans-serif;color:#333333;"><div> for(java.util.Map.Entry<String, Double> entry : map.entrySet()){</div> <div><span style="white-space:pre;"> </span> if(min1 == null || min1.getValue() > entry.getValue()){</div> <div><span style="white-space:pre;"> </span> <span style="white-space:pre;"> </span>min1 =entry;</div> <div><span style="white-space:pre;"> </span> }</div> <div><span style="white-space:pre;"> </span>}</div> <div><span style="white-space:pre;"> </span> station = min1.getKey(); </div></div> <div style="font-family:gulim, Dotum, Helvetica, AppleGothic, sans-serif;color:#333333;"><br></div> <div style="font-family:gulim, Dotum, Helvetica, AppleGothic, sans-serif;color:#333333;">==>> 최소값은 <span style="font-size:9pt;">station = min1.getKey(); 여기 저장되있고요</span></div> <div style="font-family:gulim, Dotum, Helvetica, AppleGothic, sans-serif;color:#333333;"><span style="font-size:9pt;"><br></span></div> <div style="font-family:gulim, Dotum, Helvetica, AppleGothic, sans-serif;color:#333333;"><div>for(int i=0;i<table.getColumnCount();i++){</div> <div><span style="white-space:pre;"> </span>m.Try_catch(address[i]);</div> <div><span style="white-space:pre;"> </span>System.out.println(address[i]);</div> <div><span style="white-space:pre;"> </span>m.PutMap();</div> <div><span style="white-space:pre;"> </span>station = m.station;</div> <div><span style="white-space:pre;"> </span>String word1 = station.split(" ")[0]; </div> <div><span style="white-space:pre;"> </span>String word2 = station.split(" ")[1]; </div> <div><span style="white-space:pre;"> </span>System.out.println("관측소 이름:" + word1); </div> <div><span style="white-space:pre;"> </span>System.out.println("관측소 번호:" + word2); </div> <div><span style="white-space:pre;"> </span>System.out.println("----------------------------------");</div> <div><span style="white-space:pre;"> </span>table.setValueAt(word1, i, 5);</div> <div><span style="white-space:pre;"> </span>m.x1=0;</div> <div><span style="white-space:pre;"> </span>m.y1=0;</div> <div><span style="white-space:pre;"> </span>word1=null;</div> <div><span style="white-space:pre;"> </span>}</div></div> <div style="font-family:gulim, Dotum, Helvetica, AppleGothic, sans-serif;color:#333333;"><br></div> <div style="font-family:gulim, Dotum, Helvetica, AppleGothic, sans-serif;color:#333333;">==>> 여기서 테이블의 크기만큼 반복문을 돌리면서 최소값을 테이블에 저장합니다..</div> <div style="font-family:gulim, Dotum, Helvetica, AppleGothic, sans-serif;color:#333333;">근데 문제는 값이 제대로 저장이 안돼요 반복문 안돌리고 개별적으로 돌려보면 다 제대로 나오는데 반복문만 돌리면</div> <div style="font-family:gulim, Dotum, Helvetica, AppleGothic, sans-serif;color:#333333;">똑같은값만 세개씩 나옵니다 ㅠㅠ 왜이러는 걸까요</div>
댓글 분란 또는 분쟁 때문에 전체 댓글이 블라인드 처리되었습니다.