Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
1 年の分数を計算して出力する単純な Java プロジェクトを作成しています。案内してもらえますか。ありがとう。
通常と閏年の両方。
public int getMinutesFromYear(int year) { return ((year % 400) == 0) ? 366 * 24 * 60 : (year % 100 != 0 && year % 4 == 0) ? 366 * 24 * 60 : 365 * 24 * 60; }
60*24*365 = 525600 - 通常の年 60*24*366 = 527040 - 閏年
トピックの終わり。