日期:2014-05-17 浏览次数:20869 次
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
DateTime dt1 = new DateTime(2013, 12, 5, 9, 0, 0);
DateTime dt2 = new DateTime(2013, 12, 5, 13, 0, 0);
Console.WriteLine(foo(dt1, dt2));
}
static double foo(DateTime start, DateTime end)
{
Dictionary<int, List<int>> rate = new Dictionary<int, List<int>>()
{
{ 0, new List<int>() { 0, 1, 2, 3, 4, 5, 6, 7 } },
{ 5, new List<int>() { 8, 9 } },
{ 10, new List<int>() { 10, 11 } },
{ 15, new List<int>() { 12, 13, 14 } },
{ 20, new List<int>() { 15, 16, 17, 18, 19, 20, 21, 22, 23 } }
};
&