简单的从一行输入的字符串中通过特定的字符将字符串切割成几个字符串, 简单的题目, 代码如下:
import java.io.BufferedReader; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws Exception{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String[] str = br.readLine().split("-"); System.out.println(str[2]+"-"+str[0]+"-"+str[1]); } }