We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
class Program { static void Main() { DateTime start = new DateTime(2024, 1, 1, 0, 0, 0); // 起始时间 DateTime end = new DateTime(2024, 1, 20, 22, 0, 0); // 结束时间 TimeSpan interval = TimeSpan.FromHours(2); // 步进值 for (DateTime current = start; current <= end; current = current.Add(interval)) { // Console.WriteLine(current); // 打印当前时间 int year = current.Year; int month = current.Month; int day = current.Day; int hour = current.Hour; //Console.WriteLine($"年: {year}, 月: {month}, 日: {day}, 时: {hour}"); // 输出时间点和 "男" Console.WriteLine($"年: {year}, 月: {month}, 日: {day}, 时: {hour}, 性别: 男"); // 输出时间点和 "女" Console.WriteLine($"年: {year}, 月: {month}, 日: {day}, 时: {hour}, 性别: 女"); } } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The text was updated successfully, but these errors were encountered: