大致是这样的:private static void ConvertToTime(int num) int hour = 0; int minu = 0; int second = 0; if (num > 0) int temp = num / 3600; if (temp > 0) hour = temp; temp = (num %3600) / 60; if (temp > 0) minu = temp; } } else temp = num / 60; if (temp > 0) minu = temp; second = num % 60; } else second = num; } } Console.WriteLine(" } }