import java.io.*;
import java.util.regex.*;
class mysplit{
public static void mysplit(String path){
String regex="\\\\";//java中"\\"表示字符'\',在正则表达式中则用"\\\\"匹配java字符串中的"\\"
for(String s:path.split(regex))
System.out.println(s);
}
public static void main(String[] args){
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String path=null;
try{
while((path=br.readLine())!=null){
if("over".equals(path))
break;
mysplit(path);
}
}catch(IOException e){
throw new RuntimeException(e);
}
}
} |
|