CF245B.Internet Address
普及-
通过率:0%
时间限制:2.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Vasya is an active Internet user. One day he came across an Internet resource he liked, so he wrote its address in the notebook. We know that the address of the written resource has format:
where:
can equal either "http" (without the quotes) or "ftp" (without the quotes), is a non-empty string, consisting of lowercase English letters, - the /
part may not be present. If it is present, then is a non-empty string, consisting of lowercase English letters.
If string
When the boy came home, he found out that the address he wrote in his notebook had no punctuation marks. Vasya must have been in a lot of hurry and didn't write characters ":", "/", ".".
Help Vasya to restore the possible address of the recorded Internet resource.
瓦西娅是一名活跃的互联网用户。一天,他偶然发现了一个喜欢的网络资源,于是将该资源的地址记在了笔记本上。已知所记录的资源地址格式为:
其中:
只能是 "http"(不带引号)或"ftp"(不带引号);是一个非空字符串,仅由小写英文字母组成; /` 部分可选;若存在,则 是一个非空字符串,仅由小写英文字母组成。
如果地址中未出现字符串 / 也不会被写出。因此,该地址中斜杠 / 的总数为两个(即 :// 中的两个 /),或三个(若 <context> 存在,则多出一个位于其前面的 /)。
当男孩回到家后,他发现笔记本上记录的地址中没有任何标点符号。瓦西娅当时一定非常匆忙,因而漏写了字符 ":"、"/" 和 "."。
请帮助瓦西娅还原出该记录的网络资源可能的原始地址。
输入格式
The first line contains a non-empty string that Vasya wrote out in his notebook. This line consists of lowercase English letters only.
It is guaranteed that the given string contains at most 50 letters. It is guaranteed that the given string can be obtained from some correct Internet resource address, described above.
第一行包含一个非空字符串,即瓦西娅在笔记本中写下的字符串。该字符串仅由小写英文字母组成。
保证给定字符串最多包含 50 个字母。保证给定字符串可由上述某个合法的互联网资源地址得到。
输出格式
Print a single line — the address of the Internet resource that Vasya liked. If there are several addresses that meet the problem limitations, you are allowed to print any of them.
输出一行——即瓦夏喜欢的互联网资源地址。如果存在多个满足题目限制条件的地址,您可以任选其一输出。
输入输出样例
输入#1
httpsunrux
输出#1
http://sun.ru/x
输入#2
ftphttprururu
输出#2
ftp://http.ru/ruru
说明/提示
In the second sample there are two more possible answers: "ftp://httpruru.ru" and "ftp://httpru.ru/ru".
在第二个样例中还有两个可能的答案:“ftp://httpruru.ru”和“ftp://httpru.ru/ru”。
输入解题思路,AI测评打分。不知道怎么写?