¹®Á¦°¡ ³À̵µ°¡ Àֳ׿ä...½ÇÁ¦·Î ÃâÁ¦µÇ±â´Â ¾î·Æ°Ú½À´Ï´Ù. (¼öÁØÀÌ »ó´çÇϽó׿ä.^^)
¹®Á¦ Ç®ÀÌÀÇ ÇÙ½ÉÀº °øÀåÄڵ庰 Çհ踦 ±¸ÇÏ´Â °ÅÁÒ...
¿ì¸®´Â ÀϹÝÀûÀ¸·Î AÀ϶§ BÀ϶§ ÀÌ·±½ÄÀ¸·Î ǥ󸮸¦ ¸¹ÀÌ Çߴµ¥...¾î¶² ¹®ÀÚ°¡ ¿ÃÁö ¸ð¸£´Ï IF¹®,Select¹®À» ÀÌ¿ëÇؼ ¸ðµç ¹®ÀÚ¿¡ ´ëÇØ Á¶°ÇÀ» ó¸®Çϱâ´Â ¾î·Æ½À´Ï´Ù. ±×·³...¾î¶»°Ô ÇØ°áÇØ¾ß ÇÒ±î¿ä? ³»ÀåÇÔ¼ö¸¦ Çϳª´õ °øºÎÇÏ¼Å¾ß ÇÕ´Ï´Ù. ¹¹³ÄÇϸé...
¹®ÀÚ¸¦ ¾Æ½ºÅ°Äڵ尪(Á¤¼ö)À¸·Î º¯È¯ÇÏ´Â ³»ÀåÇÔ¼öÀÔ´Ï´Ù.=>Asc()
±×¸®°í, ¶Ç Çϳª´Â ¹®Á¦°¡ ÃÖ´ë°ªÀ» ±¸Ç϶ó´Â ¹®Á¦ÀÌÁö¸¸ Á¤·Ä·Î Ç®ÀÌ ÇÏ¼Å¾ß ÇÕ´Ï´Ù.
¿Ö³ÄÇϸé,....¹è¿º¯¼ö¿¡ ÀúÀåÇÏ°í ±× °ªµé Áß¿¡¼ ÃÖ´ë°ªÀ» ±¸ÇØ¾ß ÇϹǷΠÃÖ´ë°ªÀ» ±¸Ç϶ó°í ÇÏ¸é ¹è¿º¯¼ö¸¦ ³»¸²Â÷¼øÇÏ°í ù¹ø° °ªÀ» Ãâ·ÂÇÏ¸é µË´Ï´Ù. ±×¸®°í ÃÖ¼Ò°ªÀº ¿À¸§Â÷¼øÈÄ Ã¹¹ø° °ªÀ» Ãâ·ÂÇÏ¸é µÇ°ÚÁÒ^^ ÀÌÇØ°¡ µÇ½Ã´ÂÁö...
¹®ÀÚº° ¾Æ½ºÅ°Äڵ尪Àº ÀÚ·á½Ç¿¡ ¿Ã·Á³õ°Ú½À´Ï´Ù. Âü°íÇϼ¼¿ä. ±×·³ ¼Ò½º µé¾î°©´Ï´Ù.^^
Option Explicit
Sub main()
''''Çʼö º¯¼ö ¼±¾ð Dim Àμö1, Àμö2, i, ¹öÆÛ As Variant ''''ÇÙ½É º¯¼ö ¼±¾ð Dim ´Ü°¡, °øÀåÄÚµå, ¸ÅÃâ¾×(1000), j, Temp, Num As Variant ''''Àμö ó¸® Àμö1 = Val(Left(Command, InStr(Command, " "))) Àμö2 = Val(Mid(Command, InStr(Command, " "))) ''''ÀÔ·Â ÆÄÀÏ Ã³¸® Open "c:\c_it\data\abc0005.txt" For Input As #1 For i = 1 To Àμö2 Line Input #1, ¹öÆÛ If i >= Àμö1 Then ''''º¯¼ö ÀúÀå ´Ü°¡ = Val(Mid(¹öÆÛ, 12, 3)) °øÀåÄÚµå = Trim(Mid(¹öÆÛ, 18, 1)) ''''°øÀåÄڵ庰 ¸ÅÃâ¾× ÇÕ°è (°øÀåÄڵ带 ¾Æ½ºÅ°Äڵ尪À¸·Î º¯È¯ÇÏ¿© ¹è¿º¯¼ö À§Ä¡¸¦ Á¤ÇÔ) ''''Asc() ´Â ¹®ÀÚÀÇ ¾Æ½ºÅ°Äڵ尪À» ¹ÝȯÇÔ. If ´Ü°¡ >= 30 Then Num = Asc(°øÀåÄÚµå) ¸ÅÃâ¾×(Num) = ¸ÅÃâ¾×(Num) + Val(Mid(¹öÆÛ, 26, 3)) End If End If Next i ''''¸ÅÃâ¾× ¹è¿º¯¼ö Áß¿¡¼ ³»¸²Â÷¼ø Á¤·ÄÈÄ Ã¹¹ø°°ªÀ» Ãâ·ÂÇÏ¸é µÊ=>¸ÅÃâ¾×(1) ''''Á¤·Ä(¸ÅÃâ¾× ³»¸²Â÷¼ø) ÁÖÀÇ:Num¹ø°±îÁö°¡ ¾Æ´Ï¶ó 1,000¹ø° ±îÁöÀÔ´Ï´Ù. For i = 1 To 1000 For j = i To 1000 If ¸ÅÃâ¾×(i) < ¸ÅÃâ¾×(j) Then Temp = ¸ÅÃâ¾×(i) ¸ÅÃâ¾×(i) = ¸ÅÃâ¾×(j) ¸ÅÃâ¾×(j) = Temp End If Next j Next i Close #1 ''''Ãâ·Â ÆÄÀÏ Ã³¸® Open "c:\c_it\data\ans1.txt" For Output As #2 Print #2, Àμö1, Àμö2, ¸ÅÃâ¾×(1) Close #2 End Sub |