11¿ù4ÀÏ ¿ÀÈÄ 4¹ø ¹®Á¦¿©,, ¾Æ¹«¸®ºÁµµ ¸ð¸£°Ú¾î¿©..¤Ð.¤Ð
¹®Á¦ 4¡½
´ãÀÓÄڵ忡 µû¸¥ Á¡¼öÆ÷ÀÎÆ®
´ãÀÓÄÚµå Á¡¼öÆ÷ÀÎÆ®
A 10
B 15
C 20
À§ÀÇ Ç¥¸¦ ÂüÁ¶ÇÏ¿© Áö¿ªÄڵ尡 BÀÎ ÀÚ·áÀÇ (±¹¾îÁ¡¼ö + Á¡¼öÆ÷ÀÎÆ®)°¡ 50 ÀÌ»óÀÎ ÀÚ·áÀÇ °Ç¼ö Ãâ·ÂÇϽÿÀ(30Á¡)
(¡Ø °á°ú °ªÀº ¼ö°ËÀÚ PCÀÇ C:\C_it\data\Ans4.txt ÆÄÀÏ¿¡ Ãâ·ÂµÇµµ·Ï ÇÁ·Î±×·¥À» ÀÛ¼ºÇÒ °Í)
È®Àδä¾È 1Â÷ (½ÇÁ¦ µ¥ÀÌÅ͸¦ »ç¿ëÇÑ ´ä¾È)
¹®Á¦ 4¡½ 100 200 21
----------------------------------------------------------------------
Option Explicit Sub main()
''Çʼöº¯¼ö¼±¾ð Dim Àμö1, Àμö2, i, ¹öÆÛ As Variant
''Çٽɺ¯¼ö¼±¾ð Dim ´ãÀÓÄÚµå, Á¡¼öÆ÷ÀÎÆ®, Áö¿ªÄÚµå, ±¹¾îÁ¡¼ö, Num As Variant
''Àμöó¸® Àμö1 = Val(Left(Command, InStr(Command, " "))) Àμö2 = Val(Mid(Command, InStr(Command, " ")))
''ÀÔ·ÂÆÄÀÏó¸® Open "c:\c_it\data\Abc1115.txt" For Input As #1 For i = 1 To Àμö2 Line Input #1, ¹öÆÛ If i >= Àμö1 Then
''º¯¼öÀúÀå ´ãÀÓÄÚµå = Trim(Mid(¹öÆÛ, 29, 1)) Áö¿ªÄÚµå = Trim(Mid(¹öÆÛ, 31, 1)) ±¹¾îÁ¡¼ö = Val(Mid(¹öÆÛ, 11, 3))
''ǥó¸® Select Case ´ãÀÓÄÚµå Case "A" Á¡¼öÆ÷ÀÎÆ® = 10 Case "B" Á¡¼öÆ÷ÀÎÆ® = 15 Case "C" Á¡¼öÆ÷ÀÎÆ® = 20 End Select
End If Next i
''Num±¸Çϱâ If Áö¿ªÄÚµå = "B" And (±¹¾îÁ¡¼ö + Á¡¼öÆ÷ÀÎÆ®) >= 50 Then Num = Num + 1 End If
Close #1
''Ãâ·ÂÆÄÀÏó¸® Open "c:\c_it\data\ans4.txt" For Output As #2 Print #2, Àμö1, Àμö2, Num Close #2
End Sub
|