//提取出身份证号的年月日
public class Demo4_shengfengzhen {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String s = sc.nextLine();
System.out.println(s);
String nian = s.substring(6,10);
String yue = s.substring(10,12);
String ri = s.substring(12,14);
System.out.println(nian + "年" + yue + "月" + ri + "日");
}
}
|
|