题解 | #Biorhythms#暴力枚举就行
Biorhythms
https://www.nowcoder.com/practice/aa66f85934c142f3af2da111dc864d9f
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int p = sc.nextInt(); int e = sc.nextInt(); int i = sc.nextInt(); int d = sc.nextInt(); int ans = d; while (ans == 0 || (ans - p) % 23 != 0 || (ans - e) % 28 != 0 || (ans - i) % 33 != 0) { ans++; } System.out.println("Case: the next triple peak occurs in " + (ans - d) + " days."); } }