300090: CF20A. BerOS file system
Memory Limit:64 MB
Time Limit:2 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
BerOS file system
题意翻译
### 题目描述 新的操作系统BerOS有一个很好的特性。可以在路径中使用任意数量的字符“/”作为分隔符,而不是使用一个传统的“/”。例如,字符串`//usr///local//nginx/sbin//`和`/usr/local/nginx///sbin//`是等效的。只有根目录的路径可以表示为单个字符“/”,才需要路径末尾的字符“/”(或此类字符的某些序列)。 如果路径包含尽可能少的字符数“/”,则称为normalized的路径。 您的任务是将给定路径转换为规范化形式。 ### 输入格式 一行,仅包含小写字母和`/`的字符串,保证路径至少含有一个`/`,不超过 $100$ 个字符。 ### 输出格式 一行,一个字符串,表示简化后的路径。题目描述
The new operating system BerOS has a nice feature. It is possible to use any number of characters '/' as a delimiter in path instead of one traditional '/'. For example, strings //usr///local//nginx/sbin// and /usr/local/nginx///sbin are equivalent. The character '/' (or some sequence of such characters) at the end of the path is required only in case of the path to the root directory, which can be represented as single character '/'. A path called normalized if it contains the smallest possible number of characters '/'. Your task is to transform a given path to the normalized form.输入输出格式
输入格式
The first line of the input contains only lowercase Latin letters and character '/' — the path to some directory. All paths start with at least one character '/'. The length of the given line is no more than 100 characters, it is not empty.
输出格式
The path in normalized form.
输入输出样例
输入样例 #1
//usr///local//nginx/sbin
输出样例 #1
/usr/local/nginx/sbin