-1
讓我們假設我們的序列是如何獲得獨立序列的第n個元素?
3,9,7,1,然後重演3,9,7,1,等等...
我們如何檢查什麼樣的價值是要在例如第605個元素(在這種情況下它將是3)
PS:「獨立」我的意思是我們找不到數學公式。
在此先感謝:P
編輯添加無效代碼。
public static int determine_value_at_position_of_an_array(List<int> sequence, int power)
{
int counter = 1; /// This index is going to value of power.
int counter_2 = 0; /// This variable is responsible for jumping between [0..sequence.count-1]
int current_value = 0;
for (; counter<= power; counter++)
{
current_value = sequence[counter_2];
if (counter_2==sequence.Count-1) /// if we're at last element, then go to 1st
{
counter_2 = 0;
}
else
{
counter_2++;
}
}
return current_value;
}
請告訴我們你一直在努力,實現這一目標是什麼。例如,一些代碼不需要工作。有關如何提問的更多信息,請查看[help-center](https://stackoverflow.com/help/how-to-ask) – Deathstorm
@Deathstorm添加了代碼。 – Xiaox