110,536
社区成员
发帖
与我相关
我的任务
分享
int[] arr = { 1, 2, 3, 4, 5,
6, 7, 8, 9, 10,
11, 12, 13, 14, 15 };
double x = 2.3;
int Split = 5;
int resultX = (int)x;
int resultY = (int)(x * 10 % 10);
int result = resultX * Split + resultY - 1;
Console.WriteLine(arr[result]);