我不太确定该怎么做。
伪代码:
array1 = {"a","b", "c", "d", "e","f", "g","h", "i","j"} //there might be more values.
take c
loop =>c+3 =f
f+3 =i
i+3 =b
b+3 =e
......
end loop
我需要做这个array1
as a circle并找到字母加 3(f、i、b、e 等)。
使用模(%
), then index
可以是任何正值并且它会环绕:
int index;
array1[index % array1.Length]
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)