a071: Retrieve the telephone number 取出電話號碼
標籤 : String 字串
通過比率 : 100% (9 人 / 9 人 ) (非即時)
評分方式 :
Tolerant

最近更新 : 2019-03-08 13:57

內容

The source code a web page is a text file of html format. For example, the following text is a part of the source code of a web page.

<footer>
<div class="width">
<img src="images/footer-logo.png">
<p class="foot-right">© Chang Jung Christian University.All Rights Reserved.Designed by <a href="http://www.weya.com.tw/" target="_blank">Weya</a></p>
<div class="foot-left">
<p>Address : No.1,Changda Rd.,Gueiren District, Tainan City 71101, Taiwan(R.O.C.)</p>
<p> Tel:886-6-2785980  Fax:886-6-2785979  Email:[email protected]</p>
</div> <!--_________ foot-span_________-->
</div> <!--_________ width_________-->
</footer>

In the web pages, the phone number consists of number digits and ‘-’ with the format “xxx-x-xxxxxxx” or “xx-xxxxxxx” and always occurs right after the keyword “Tel:”. Please write a program to retrieve the phone number from a web page source code.

網頁的原始碼是html格式的純文字文件。例如,以下文字是某個網頁原始碼的一部分。
<footer>
<div class="width">
<img src="images/footer-logo.png">
<p class="foot-right">© Chang Jung Christian University.All Rights Reserved.Designed by <a href="http://www.weya.com.tw/" target="_blank">Weya</a></p>
<div class="foot-left">
<p>Address : No.1,Changda Rd.,Gueiren District, Tainan City 71101, Taiwan(R.O.C.)</p>
<p> Tel:886-6-2785980  Fax:886-6-2785979  Email:[email protected]</p>
</div> <!--_________ foot-span_________-->
</div> <!--_________ width_________-->
</footer>

在網頁中,電話號碼由數字和“-”組成,格式為“xxx-x-xxxxxxx”或“xx-xxxxxxx”,並且始終緊跟在關鍵字“Tel:”之後。 請撰寫程式以從網頁原始碼中取出電話號碼。

 

輸入說明

The input consists of a string of web page source code. The length of the input string is less than 10000.

輸入包含一個網頁原始碼字串。輸入字串的長度小於10000。

輸出說明

The output contains one line of the first searched telephone number. If there exists no telephone number searched, output “N/A”.

輸出一行第一個搜索到的電話號碼。如果沒有搜索到電話號碼,則輸出“N/A”。

範例輸入
<footer>
        <div class="width">
        <img src="images/footer-logo.png">
        <p class="foot-right">© Chang Jung Christian University.All Rights Reserved.Designed by <a href="http://www.weya.com.tw/" target="_blank">Weya</a></p>
        <div class="foot-left">
        <p>Address : No.1,Changda Rd.,Gueiren District, Tainan City 71101, Taiwan(R.O.C.)</p>
        <p>       Tel:886-6-2785980  Fax:886-6-2785979  Email:[email protected]</p>
        </div> <!--_________ foot-span_________-->  
        </div> <!--_________ width_________-->    
</footer>
範例輸出
886-6-2785980
測資資訊 :
記憶體限制 : 64 MB
隱藏 測資點#0 (50%): 1.0s , <1K
隱藏 測資點#1 (50%): 1.0s , <1K
提示 :
標籤:
String 字串
出處:
線上協同學習平臺 - ITSA 教育部資通訊軟體創新人才推升計畫 [編輯 :
zero_jason (zero_jason(MANAGER))
]


編號 身分 題目 主題 人氣 發表日期
沒有發現任何「解題報告」