Console.Write("Type in the number of seconds: ");
int total_seconds = Convert.ToInt32(Console.ReadLine());
int hours = total_seconds / 3600;
total_seconds = total_seconds % (hours * 3600);
int minutes = total_seconds / 60;
total_seconds = total_seconds % (minutes * 60);
int seconds = total_seconds;
Console.WriteLine("Number of hours: " + hours + " hours" + "\nNumber of minutes: " + minutes + " minutes" + "\nNumber of seconds: " + seconds + " seconds");
Console.ReadLine();
秒の合計量をそれぞれの時間、分、秒に変換するプログラムを作成することに成功しました。私はプログラムが3660秒未満の合計時間、分などを表示できるようにしたくないので問題を抱えていますが、これは可能ではないようです。この問題を解決する方法はありますか?