split方法不会用了,切割"."要转义
package com.company;
package com.company;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// write your code here
Scanner sc=new Scanner(System.in);
String p=sc.next();
String a=sc.next();
String[] p1=p.split("\\.");
String[] a1=a.split("\\.");
long ka=0,kp=0,kc,g,k,s;
kp= Integer.parseInt(p1[0])*29*17+Integer.parseInt(p1[1])*29+Integer.parseInt(p1[2]);
ka= Integer.parseInt(a1[0])*29*17+Integer.parseInt(a1[1])*29+Integer.parseInt(a1[2]);
kc=ka-kp;
g=kc/(29*17);
s=(kc-g*29*17)/29;
k=(kc-g*29*17)%29;
if (kc>0){
System.out.println(g+"."+s+"."+k);
}
else{
System.out.println(g+"."+(-1)*s+"."+(-1)*k);
}
}
}