import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
String[] str = bf.readLine().split(" ");
//Galleon.Sickle.Knut用小数点分开,正则表示必须用"\\."表示小数点
String[] P = str[0].split("\\.");//应付
String[] K = str[1].split("\\.");//实付
long Galleon, Sickle, Knut;
int sum_need = Integer.parseInt(P[0]) * 17 * 29 + Integer.parseInt(P[1]) * 29 + Integer.parseInt(P[2]);
int sum_give = Integer.parseInt(K[0]) * 17 * 29 + Integer.parseInt(K[1]) * 29 + Integer.parseInt(K[2]);
int cha = sum_give - sum_need;
if (cha < 0) {
System.out.print("-");
cha = -cha;
}
Knut = cha % 29;
Sickle = (cha / 29) % 17;
Galleon = (cha / 29) / 17;
System.out.println(Galleon + "." + Sickle + "." + Knut);
}
}
PAT_B_1037_Java(20分)
最新推荐文章于 2020-11-03 21:41:36 发布