Çʱ⠿À´Ã È®ÀÎÇغ¸´Ï±î (±â»ç 92Á¡ / »ê¾÷±â»ç 86Á¡) ³ª¿Ô³×¿ä....^^
À½ ±Ç°»ç´Ô ÄÚµùÀ¸·Î È®ÀÎÀÌ ¾ÈµÇ´Â ¹®Á¦°¡ ÀÕ¾î¼ ÄÚµù ó¸® ¹æ½ÄÀ» ºÎŹµå¸³´Ï´Ù...
¹®Á¦´Â Áß±ÞÇüÅ¿¡¼ Çѹø ´õ ²¿¾Æ³õÀº ¹®Á¦ ÀÎ°Í °°Àºµ¥ ´äÀÌ Æ²·Á¼¿ä...
¹®Á¦¸¦ Ç®ÀÌ°úÁ¤ÀÇ ¸ÆÀ» ¾î¶»°Ô Àâ¾Æ¾ß ÇÏ´ÂÁö ¾Ë·ÁÁÖ¼¼¿ä....¤Ì¤Ì;;
¹®Á¦´Â ¿Â÷Äڵ尡 Z·Î ³¡³ª°Å³ª ¿ùÀÌ¿ëȽ¼ö°¡ 7ÀÌ»óÀÎ ÀÚ·á¿¡ ´ëÇÏ¿© (¿©Çà°Å¸® - ž½ÂÀοø)¿¡ µû¶ó ³»¸²Â÷¼øÀ¸·Î Á¤·ÄÇßÀ» ° 11¹ø° Á¼®Äڵ带 Ãâ·ÂÇϽÿÀ. µ¿ÀÏ °ª ¹ß»ý½Ã °í°´¹øÈ£¿¡ ´ëÇØ ¿À¸§ Â÷¼øÀ¸·Î Á¤·ÄÇÏ¿© ó¸®ÇϽÿÀ
Ã¥¿¡³ª¿Â Á¤´äÀº Àμö°ª 479 599 ====> BD °¡ ³ª¿À´Âµ¥ Àú´Â NT°¡ ³ª¿É´Ï´Ù ¤Ì¤Ì;;
Option Explicit
Sub main()
''Çʼöº¯¼öÁöÁ¤
Dim Àμö1, Àμö2, i As Long Dim ¹öÆÛ As String ''Çٽɺ¯¼öÁöÁ¤
Dim ¿ùÀÌ¿ëȽ¼ö, ¿©Çà°Å¸®, ž½ÂÀοø, ÇÕ°è(1000), temp1, num, j As Long
Dim ¿Â÷ÄÚµå, °í°´¹øÈ£(1000), Á¼®ÄÚµå(1000), temp2 As String
''ÀμöÁöÁ¤
Àμö1 = Val(Left(Command, InStr(Command, " "))) Àμö2 = Val(Mid(Command, InStr(Command, " "))) ''ÀÔ·ÂÆÄÀÏÁöÁ¤
Open "c:\c_it\data\abc0015.txt" For Input As #1 For i = 1 To Àμö2 Line Input #1, ¹öÆÛ If i >= Àμö1 Then ''º¯¼ö°ªÁöÁ¤ ¿ùÀÌ¿ëȽ¼ö = Val(Right(¹öÆÛ, 2)) ¿©Çà°Å¸® = Val(Mid(¹öÆÛ, 27, 5)) ž½ÂÀοø = Val(Mid(¹öÆÛ, 24, 3)) ¿Â÷ÄÚµå = Trim(Mid(¹öÆÛ, 6, 2)) ''Ç¥ÀÛ¼º ''ÇÙ½É¾Ë°í¸®Áò If ¿Â÷ÄÚµå = "Z" Or ¿ùÀÌ¿ëȽ¼ö >= 7 Then num = num + 1 ÇÕ°è(num) = (¿©Çà°Å¸® - ž½ÂÀοø) Á¼®ÄÚµå(num) = Trim(Mid(¹öÆÛ, 8, 2)) °í°´¹øÈ£(num) = Val(Left(¹öÆÛ, 5)) End If End If Next i ''Á¤·Ä¾Ë°í¸®Áò For i = 1 To num For j = i To num If (ÇÕ°è(i) < ÇÕ°è(j)) Or ((ÇÕ°è(i) = ÇÕ°è(j)) And (°í°´¹øÈ£(i) > °í°´¹øÈ£(j))) Then temp1 = ÇÕ°è(i) ÇÕ°è(i) = ÇÕ°è(j) ÇÕ°è(j) = temp1 temp2 = °í°´¹øÈ£(i) °í°´¹øÈ£(i) = °í°´¹øÈ£(j) °í°´¹øÈ£(j) = temp2 End If Next j Next i Close #1 ''Ãâ·ÂÆÄÀÏÁöÁ¤ Open "c:\c_it\data\ans1.txt" For Output As #2 Print #2, Àμö1, Àμö2, Á¼®ÄÚµå(11) Debug.Print Àμö1, Àμö2, Á¼®ÄÚµå(11) Close #2 End Sub
À̹®Á¦¸¦ º¸¸é (¿©Çà°Å¸® - ž½ÂÀοø) ==> 1Â÷Á¤·Ä(³»¸²Â÷¼ø), 11¹ø° Á¼®ÄÚµåÃâ·ÂÀ̹ǷΠÁ¤·Ä°ª°ú Ãâ·Â°ªÀÌ Æ²¸®¹Ç·Î Áß±ÞÇüÅ·Π´ÜÀÌÇϸ¦ ó¸®Çؼ °í°´¹øÈ£¿¡ ´ëÇØ ¿À¸§Â÷¼øÀ» ó¸® ==> 2Â÷ Á¤·Ä ÇÏ´Â ¹®Á¦ÀÎ°Í °°Àºµ¥ ´äÀÌ Æ²¸®°Ô ³ª¿É´Ï´Ù....
ÀϹÝÀûÀ¸·Î Áß±ÞÇüÅÂÀÇ ¹®Á¦¸¦ º¸¸é Á¤·Ä°ª°ú Ãâ·Â°ªÀÌ Æ²¸®¸é¼ ´ÜÀÌÇϸ¦ ó¸®Çϴµ¥ ´ÜÀÌ ÇÏÃâ·Â°ªÀÌ Ãâ·Â°ª°ú µ¿ÀÏÇÏ°Ô ³ª¿À´Âµ¥ À̹®Á¦´Â Ʋ¸®°Åµç¿ä...¾î¶»°Ô ÇؾßÇÏ´ÂÁö ¾Ë·ÁÁÖ¼¼¿ä..........
|