import java.util.Scanner;
public class helloworld{
public static void main(String[] args){
Scanner myScanner=new Scanner(System.in);
String s=myScanner.next();
int sum=0;
//.lastIndexOf()指定字符串最后出现的索引值
//String[] split=s.split(".")根据字符进行分割字符串
//indexOf 返回第一次出现的索引
for(int i=s.lastIndexOf('$')+1;i<s.indexOf('*');i++){
sum^=s.charAt(i);
}
int num=(int)sum%65536;
int num2=Integer.parseInt(s.substring(s.indexOf('*')+1,16));
//}
String[] s1=s.split(",");
if(num==num2){
int num3=Integer.parseInt(s1[1])%24;
int num4=Integer.parseInt(s1[1])%1440;
int num5=Integer.parseInt(s1[1])%86400;
if(num3<10)
System.out.print("0"+num3+":");
else
System.out.print(num3+":");
if(num4<10)
System.out.print("0"+num4+":");
else
System.out.print(num4+":");
if(num5<10)
System.out.print("0"+num5);
else
System.out.print(num5);
}
}
}
平台上显示非零返回
idea上显示