private void Get_Min_Money_Data(string str1, string str2) { Queue <int> Qu1 = grp1.ShortestPath_Money(str1, str2); int index; int n = Qu1.Dequeue(); int m; long time = 0; long day = 0; long end_time = 0; dataGridView2.Rows.Clear(); while (Qu1.Count > 0) { m = n; n = Qu1.Dequeue(); index = dataGridView2.Rows.Add(); dataGridView2.Rows[index].Cells[0].Value = grp1.IDToName(m); dataGridView2.Rows[index].Cells[1].Value = grp1.IDToName(n); if (end_time > grp1.Get_Go_Time(m, n)) { day++; } time = grp1.Get_Go_Time(m, n) + day * 24 * 60; end_time = grp1.Get_Trans_Time(m, n) + grp1.Get_Go_Time(m, n); dataGridView2.Rows[index].Cells[2].Value = Min_To_Time(time); time += grp1.Get_Trans_Time(m, n); dataGridView2.Rows[index].Cells[3].Value = Min_To_Time(time); dataGridView2.Rows[index].Cells[4].Value = Min_To_Time(grp1.Get_Trans_Time(m, n)); dataGridView2.Rows[index].Cells[5].Value = grp1.Get_Money(m, n) + "元"; dataGridView2.Rows[index].Cells[6].Value = grp1.Get_Road_Trans(m, n); } }