Pro.ID1519 TitleSPAM Title链接http://10.20.2.8/oj/exercise/problem?problem_id=1519 AC4 Submit6 Ratio66.67% 时间&空间限制描述You never had any friends, and don't really want any anyways, and so you have decided to collect email addresses from web pages for direct e-mail advertising. The text delivered to a web browser is usually marked up HTML, which may contain email addresses of the form: user@server ¨ Bothuserandserverare of the formalpha.numeric.with.dots. Byalpha.numeric.with.dots, we mean a sequence of one or more characters which are alphabetic ( A-Z, a-z ), numeric ( 0-9 ), hyphens (-), underbars (_) and/or periods (.), with the following restrictions on periods: n The sequence neither starts nor ends with a period. n No periods are adjacent. ¨ Email addresses are preceded by the beginning of the file, or some character other than a letter ( A-Z, a-z ), digit ( 0-9), hyphen (-), or underbar (_). ¨ Email addresses are succeeded by the end of the file, or some character other than a letter ( A-Z, a-z ), digit ( 0-9 ), hyphen (-), or underbar (_). ¨ If the scanned text contains a sequence of the form first@second@third Then the output should containfirst@secondandsecond@thirdas email addresses. In a longer run, each pair split by an @-sign should appear as an email address in the output. The point of this problem is to extract and record the email addresses embedded in other text. 输入The input file will contain zero or more lines of ASCII text. 输出Description You never had any friends, and don't really want any anyways, and so you have decided to collect email addresses from web pages for direct e-mail advertising. The text delivered to a web browser is usually marked up HTML, which may contain email addresses of the form: user@server ¨ Bothuserandserverare of the formalpha.numeric.with.dots. Byalpha.numeric.with.dots, we mean a sequence of one or more characters which are alphabetic ( A-Z, a-z ), numeric ( 0-9 ), hyphens (-), underbars (_) and/or periods (.), with the following restrictions on periods: n The sequence neither starts nor ends with a period. n No periods are adjacent. ¨ Email addresses are preceded by the beginning of the file, or some character other than a letter ( A-Z, a-z ), digit ( 0-9), hyphen (-), or underbar (_). ¨ Email addresses are succeeded by the end of the file, or some character other than a letter ( A-Z, a-z ), digit ( 0-9 ), hyphen (-), or underbar (_). ¨ If the scanned text contains a sequence of the form first@second@third Then the output should containfirst@secondandsecond@thirdas email addresses. In a longer run, each pair split by an @-sign should appear as an email address in the output. The point of this problem is to extract and record the email addresses embedded in other text. Input The input file will contain zero or more lines of ASCII text. Output Other than the standard leader and trailer, the output file has each email address found in the input file in the order it was found (duplicates not removed). Sample Input bob@banks.com wrote: Sample Output bob@banks.com 样例输入bob@banks.com wrote: 样例输出bob@banks.com 提示作者 |