You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks;
namespace Apewer.Run {
public class Methods {
public Methods() { // FormatMinutes();
}
void FormatMinutes() { for (var i = 0; i < 3000; i++) { var minutes = Convert.ToInt64(i); var hours = minutes / 60; minutes = minutes % 60; var days = hours / 24; hours = hours % 24;
var sb = new StringBuilder(); sb.Append("已运行"); if (days > 0) { sb.Append(" "); sb.Append(days.ToString()); sb.Append(" 天"); } if (hours > 0 || days > 0) { sb.Append(" "); sb.Append(hours.ToString()); sb.Append(" 小时"); } sb.Append(" "); sb.Append(minutes.ToString()); sb.Append(" 分钟"); var text = sb.ToString();
Console.WriteLine($"{i} - {text}"); } }
}
}
|