List<int> list = new List<int>() {1,2,3,4,5,6,7,8,9,10 }; int listindex = 0; int GetValue() { if (list.Count > 0) { if (listindex >= list.Count) listindex = 0; listindex = listindex + 1; return list[listindex - 1]; } return -1; }
时间: 2024-10-09 22:21:32